[Israel.pm] Correct way of taking a slice of a hash reference

Gaal Yahas gaal at forum2.org
Mon Jan 21 00:54:19 PST 2008


On Jan 21, 2008 10:35 AM, Amir E. Aharoni <amir.aharoni at gmail.com> wrote:
> On 21/01/2008, Gaal Yahas <gaal at forum2.org> wrote:
> > On Jan 21, 2008 10:11 AM, Amir E. Aharoni <amir.aharoni at gmail.com> wrote:
> > > The best practice according to the Perl Best Practices book is to use
> > > @{ $hash_ref }{ @keys }. (Pages 227-229).
> >
> > Not to start a flame war, but I'd suggest reading that book for ideas
> > and the discussion that might ensue, not to be taken as gospel truth
> > about True Style.
>
> It's not gospel, but it made me a better Perl programmer, and a better
> programmer overall, which is the important thing.
>
> I implement its ideas most of the time and disregard them when they
> get in the way.

Good, that's the best way to use a style guide :-)

My note was a reaction to the fact many discussions get *stopped* when
someone says "According to PBP", because of its authoritative name
(and, well, author).

Incidentally, I tend to use the explicit @{$hashref}{@keys} myself.
But not the religiously scattered whitespace...

> --
>
> Amir Elisha Aharoni
>
> English -  http://aharoni.wordpress.com
> Hebrew  - http://haharoni.wordpress.com
>
> "We're living in pieces,
>  I want to live in peace." - T. Moore
> _______________________________________________
> Perl mailing list
> Perl at perl.org.il
> http://perl.org.il/mailman/listinfo/perl
>



-- 
Gaal Yahas <gaal at forum2.org>
http://gaal.livejournal.com/



More information about the Perl mailing list