in reply to Re: param = 0, not NULL
in thread param = 0, not NULL

This is interesting.. an empty hash is false, but an empty hash reference.. is TRUE. :-)
#!/usr/bin/perl -w my %hash = (); %hash or print "empty hash is false\n"; my $hash = {}; print "empty hash ref is true\n" if $hash ;

Replies are listed 'Best First'.
Re^3: param = 0, not NULL
by davorg (Chancellor) on Mar 29, 2007 at 13:26 UTC

    There is no such thing as an "empty hash reference". Or, if there is then the only possible meaning that it could have would be an undefined scalar.

    I think you mean "a reference to an empty hash is TRUE". And that's because Perl has already allocated storage for the hash and given you a reference to it. And a reference is always true.

    --

    See the Copyright notice on my home node.

    "The first rule of Perl club is you do not talk about Perl club." -- Chip Salzenberg