in reply to Re^4: finding number of contiguous letters
in thread finding number of contiguous letters
For example suppose a list is composed of ( <a>, <b>, <c> ) where each of the a, b, c are one or more sub calls that may mutate some value, which may be used by others further down the list, will the list values be evaluated in order of a, b, c, or is it undefined?
IIUC, why don't you find out yourself?
#!/usr/bin/perl -l use strict; use warnings; BEGIN { my $foo; sub foo () { $foo } for my $n (qw/a b c d e f/) { no strict 'refs'; *$n = sub () { warn $n; $foo++ }; } } my $arr=(a,b,c,d,e,f); print foo, $arr; __END__
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^6: finding number of contiguous letters
by otto (Beadle) on May 25, 2007 at 00:27 UTC | |
by blazar (Canon) on May 25, 2007 at 07:57 UTC |