in reply to syntax issue
The @{...} around the reference is an explicit de-reference of the value between the { and }. Say you had "@$foo_bar", is this an attempt to de-reference $foo as an arrayref, followed by the string "_bar"? If so, you're doing it wrong, and it should instead be "@{$foo}_bar" Moo, C.J.$ cat /tmp/foo my %foo = ('a' => [ 'A','B' ], 'b' => 'B', 'a b' => 'A B' ); my @foo = %foo; my $foo = \@foo; print( "list: [@foo]\n", "listref deref: [@$foo]\n", ); __DATA__ list: [a ARRAY(0x1f12d48) a b A B b B] listref deref: [a ARRAY(0x1f12d48) a b A B b B]
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: syntax issue
by ikegami (Patriarch) on Dec 28, 2011 at 19:21 UTC |