There's more than one way to do things | |
PerlMonks |
Re^3: Hash keys affect sortingby shmem (Chancellor) |
on Jul 07, 2006 at 23:03 UTC ( [id://559878]=note: print w/replies, xml ) | Need Help?? |
$_ is to scalar what @_ is to array and %_ is to hash, although %_ is seldom seen in the wild.
push @data, [@_] means: $_ was split into @_; if they said push @data, @_ the array @_ would append it's elements to @data. To append @_ as one unit to @data it must be given boundaries [ ]; this construct creates an array reference. This reference (a scalar) is stored in @data, holding the elements of @_ which are copied into [ ] at the moment of creation of [ ]. See perlreftut. Think of [@_] as "scalarifying" @_ into an (anonymous) array reference; an array can only hold scalars (single values, which references happen to be). Wow. What noise ;-) hoping not to have confused you further, _($_=" "x(1<<5)."?\n".q·/)Oo. G°\ / /\_¯/(q / ---------------------------- \__(m.====·.(_("always off the crowd"))."· ");sub _{s./.($e="'Itrs `mnsgdq Gdbj O`qkdq")=~y/"-y/#-z/;$e.e && print}
In Section
Seekers of Perl Wisdom
|
|