in reply to hash deref confusion: Intermediate Perl
But, in the next line, "@$self" is syntax for dereferencing an array reference, not a hash reference!
This is called a hash slice , and in a quirk of perl syntax uses the @ sigil instead of %
my %foo; @foo{ 'hash', 'slices' } = ( 'use', 'curly braces' );
my @bar; @bar[ 1,2,3,4 ] = ( 'array', 'slices', 'use', 'square brackets' );
See also References quick reference
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: hash deref confusion: Intermediate Perl
by tobyink (Canon) on Jul 30, 2012 at 07:03 UTC | |
by Anonymous Monk on Jul 30, 2012 at 08:13 UTC | |
by tobyink (Canon) on Jul 30, 2012 at 08:30 UTC | |
by Anonymous Monk on Jul 30, 2012 at 08:37 UTC | |
|
Re^2: hash deref confusion: Intermediate Perl
by live4tech (Sexton) on Jul 30, 2012 at 14:09 UTC |