in reply to •Re: Re: Checking and undef'in hash elements in one step?
in thread One liner to Check and undef hash elements

As you said the syntax is wrong, let me tell you now, from a pure syntax point of view, this is perfectly correct Perl syntax.

Didn't you realize that NULL could be a constant?
use strict; use constant NULL => ""; my @a = (1,2,3); my @b = (); my @c = (""); print "a is empty: " . is_null(@a), "\n"; print "b is empty: " . is_null(@b), "\n"; print "c is empty: " . is_null(@c); sub is_null { my @a = @_; (@a == NULL) ? "true" : "false"; }
  • Comment on Re: •Re: Re: Checking and undef'in hash elements in one step?
  • Download Code