in reply to Re: What does $# stand for?
in thread What does $# stand for?
Actually the scalar in the first case isn't necessary since boolean context is (more or less) scalar context as is shown with the code below.
@a = (); print "try 1\n"; print "Has elements\n" if @a; push @a, 1; print "try 2\n"; print "Has elements\n" if @a;
|
|---|