develooper Front page | perl.perl5.porters | Postings from December 2009

deprecation of defined(%hash)

Thread Next
From:
Sean
Date:
December 9, 2009 08:46
Subject:
deprecation of defined(%hash)
Message ID:
839906.56377.qm@web32503.mail.mud.yahoo.com
Why was this feature deprecated?  Is there another way to check for
the existence of a hash or array without creating the associated glob?
None of the alternatives I have tried does what I want:

    main @> keys %test::
    undef
    main @> %{"test::h"} ? 1 : 0
    0
    main @> keys %test::
    'h'
    main @> defined %{"test::h2"} ? 1 : 0
    0
    main @> keys %test::
    'h'
    main @> *{"test::h3"}{HASH} ? 1 : 0
    0
    main @> keys %test::
    h  h3
    main @> defined *{"test::h4"}{HASH} ? 1 : 0
    0
    main @> keys %test::
    h  h3 h4

Thanks,
Sean


      

Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About