match variables persist between calls to a sort subroutine #10461
Comments
From @nwc10Created by @nwc10$ cat ~/tmp/sorter.pl sub sorter { warn $1; $result; "Win" =~ /(.*)/; warn "\$1 = '$1'"; my @b = sort sorter 0..2; warn "\$1 = '$1'"; print "@b\n"; print "\nNote the different behaviour for a regular function call:\n"; $a = $b = 0; __END__ Note the different behaviour for a regular function call: I believe that the output should be 'Win' every time. $ /usr/local/perl4/bin/perl4.036 sorter.pl Note the different behaviour for a regular function call: ie $1 persists between all calls to the subroutine. Alternatively, I may I've not (yet) been able to build perl 2, to see what it thinks. (obviously) still present in blead, else I wouldn't be reporting it. Nicholas Clark Perl Info
|
From @cpansproutFixed by ad021bf. |
@cpansprout - Status changed from 'new' to 'resolved' |
Migrated from rt.perl.org#76026 (status was 'resolved')
Searchable as RT76026$
The text was updated successfully, but these errors were encountered: