Example 8-8. examples/arrays/shift_argv.pl #!/usr/bin/perl
use strict;
use warnings;
my $filename = shift or die "Usage: $0 FILENAME\n";
shift defaults to shift @ARGV
Another usage of the short circuit
Slight bug (what of the first argument is 0 or the empty string ?
Does it matter?
If you are interested in on-site trainings by the author, please
contact me directly.
|