NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.
All the Perl that's Practical to Extract and Report
Stories, comments, journals, and other submissions on use Perl; are Copyright 1998-2006, their respective owners.
My way of rembering it... (Score:1)
This might not help, but I remember hash slices as follows. First really it's just a hash:
Second we do our lookup:
Slices return lists, so we need an @ sign instead of the %:
Which gives us:
You can go the other direction too. If it were just a regular hash (no reference) you'd write:
Because there's that reference there, you need to add in that $. But this way seems to confuse people more.
Reply to This