develooper Front page | perl.perl5.porters | Postings from August 2021

Re: defined $a, where $a is actually a HASH

Thread Previous | Thread Next
From:
David Nicol
Date:
August 19, 2021 21:35
Subject:
Re: defined $a, where $a is actually a HASH
Message ID:
CAFwScO_RZMiMRAm8uUAqL2KqfJ0kHN=o7+fAgnxpYNiOvi5Fpw@mail.gmail.com
> :    These have been unreachable since `defined @array` and `defined %hash`
> :    became syntax errors.
>


looks like I missed several meetings. I still expect

    no strict;
    print (defined(@arr) ? 1 : 2);
    @arr = (1);
    print (defined(@arr) ? 1 : 2);
    print (defined(%h) ? 1 : 2);
    %h = (1,2);
    print (defined(%h) ? 1 : 2);
    print "\n";

to print 2121.

I have apparently never needed to do that, but the new thing is something
like *h->{HASH}, right?


-- 
"Lay off that whiskey, and let that cocaine be!" -- Johnny Cash

Thread Previous | 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