in reply to referencing slices - love that DWIM
See subsection 2 of perlref:Making references where it says:
As a special case, \(@foo) returns a list of references to the contents of @foo, not a reference to @foo itself
Just for fun try:
print "$_" for \( %{{a =>1}}, @{[1..3]}, "fred" );; HASH(0x2251b8) ARRAY(0x194a9f4) SCALAR(0x194aaa8)
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: referencing slices - love that DWIM
by GrandFather (Saint) on May 17, 2008 at 11:59 UTC | |
by almut (Canon) on May 17, 2008 at 12:42 UTC | |
by syphilis (Archbishop) on May 17, 2008 at 13:35 UTC | |
by Fletch (Bishop) on May 17, 2008 at 13:39 UTC | |
by syphilis (Archbishop) on May 17, 2008 at 13:57 UTC | |
| |
by DrHyde (Prior) on May 19, 2008 at 09:58 UTC | |
| |
by almut (Canon) on May 17, 2008 at 14:15 UTC | |
by syphilis (Archbishop) on May 17, 2008 at 14:45 UTC | |
| |
by ysth (Canon) on May 18, 2008 at 05:57 UTC | |
by syphilis (Archbishop) on May 18, 2008 at 06:33 UTC | |
|