summaryrefslogtreecommitdiff
path: root/t/op.chop
blob: c86ea9cf3e297dab61b73f7d1d7771a6b4c3c97e (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 1.0 87/12/18 13:13:11 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;
}