summaryrefslogtreecommitdiff
path: root/t/op.chop
blob: f9ab58aaa2985e6773c0859889b5e0b4fcaf2791 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#!./perl

# $Header: op.chop,v 2.0 88/06/05 00:13:22 root Exp $

print "1..2\n";

# optimized

$_ = 'abc';
$c = do foo();
if ($c . $_ eq 'cab') {print "ok 1\n";} else {print "not ok 1\n";}

# unoptimized

$_ = 'abc';
$c = chop($_);
if ($c . $_ eq 'cab') {print "ok 2\n";} else {print "not ok 2\n";}

sub foo {
    chop;
}