in reply to Re^2: Reference madness
in thread Reference madness
Hello sdani,
I would say it's a quite unexpected behaviour..., because when I dump \@say, it prints out the expected results...
That’s because Data::Dumper (like Data::Dump) applies a dereferencing operation to its argument if that argument is a reference. This is usually what you want; but to avoid it, just print the variable instead:
23:27 >perl -MData::Dumper -wE "my @a = qw( a e i o u ); print Dumper( +\@a); print \@a;" $VAR1 = [ 'a', 'e', 'i', 'o', 'u' ]; ARRAY(0x4d2ec8) 23:27 >
Note the square brackets in the output from Data::Dumper: they denote an anonymous array reference. See perlreftut.
Hope that helps,
| Athanasius <°(((>< contra mundum | Iustus alius egestas vitae, eros Piratica, |
|
|---|