devinheitmueller
Tuesday, January 8, 2008
How not to check the argument count passed to a Perl script
Pulled this little gem from a piece of sample code a job candidate sent today:
#!/usr/bin/perl
my $numArg = scalar (@ARGV);
&usage() unless ($numArg =~ /^[1,2]$/);
Thought my fellow Perl programmers might appreciate this...
Newer Post
Older Post
Home