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;
In reply to Re: Re: What does $# stand for?
by Fletch
in thread What does $# stand for?
by Kiko
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |