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?
| Prev | Home (Copyright Gabor Szabo) Perl Training Israel | Next |
| queue (shift, push) | Up | sort, reverse |