agrundma has asked for the wisdom of the Perl Monks concerning the following question:
Output:use Data::Dumper; my $ref = []; push @{$ref}, qw(abcd efgh ijkl); print Dumper($ref); foreach my $test (@$ref) { $test = substr($test, 0, 2); } print Dumper($ref);
If this is intended behaviour for array references, please let me know. :)$VAR1 = [ 'abcd', 'efgh', 'ijkl' ]; $VAR1 = [ 'ab', 'ef', 'ij' ];
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Strange array reference behaviour (bug?)
by broquaint (Abbot) on Aug 12, 2003 at 15:47 UTC | |
|
Re: Strange array reference behaviour (bug?)
by Zaxo (Archbishop) on Aug 12, 2003 at 15:50 UTC | |
by dragonchild (Archbishop) on Aug 12, 2003 at 16:39 UTC | |
by agrundma (Novice) on Aug 12, 2003 at 17:15 UTC | |
|
Re: Strange array reference behaviour (bug?)
by edan (Curate) on Aug 12, 2003 at 15:49 UTC | |
|
Re: Strange array reference behaviour (bug?)
by sgifford (Prior) on Aug 12, 2003 at 18:27 UTC |