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

Gaal Yahas gaal at forum2.org
Mon Jan 21 00:06:35 PST 2008


Both are correct from Perl's perspective, but it looks like you're
confusing Komodo's parser. Either use another tool, or stick to the
explicit style you're already aware of which doesn't trigger the
warning.

On Jan 21, 2008 9:50 AM, Adam BE <adamb_e at yahoo.com> wrote:
>
> Hi,
>
>
>
> What is the correct way / best practice of taking a slice of a hash reference:
>
>         @{$hash_ref}{ @keys };
>
> Or:   @$hash_ref{ @keys };
>
>
>
> Using @$hash_ref{ @keys } I get a "@$hash_ref Not an ARRAY reference" warning in Komodo
>
> however I get no warning when running the same code with use strict and use warnings
>
> in the Perl debugger.
>
>
>
> Am I missing something?
>
> Thanks,
>
> Adam.
>
>
>
>
>
>       ____________________________________________________________________________________
> Looking for last minute shopping deals?
> Find them fast with Yahoo! Search.  http://tools.search.yahoo.com/newsearch/category.php?category=shopping
> _______________________________________________
> 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