SPUG: running script with the variables on the same line

Yitzchak Scott-Thoennes sthoenna at efn.org
Tue May 31 04:25:38 PDT 2005


On Mon, May 30, 2005 at 10:37:18AM -0600, Medrano-Zaldivar, L E wrote:
> $num = $#ARGV + 1; print "How many args? $num \n";

This can be just:
  $num = @ARGV; print "How many args? $num \n";

An array used in scalar context produces a count of elements.


More information about the spug-list mailing list