#!/usr/bin/perl -w # # input from command line # my ( $foo, $bar ) = @ARGV; print "foo = $foo\n"; print "bar = $bar\n"; #### #!/usr/bin/perl -w # # input from command line # my $foo = shift; my $bar = shift; print "foo = $foo\n"; print "bar = $bar\n"; #### #!/usr/bin/perl # # embed perdoc somewhere (top or bottom) for script documentation. # use warnings; use strict; use Getopt::Long; use Pod::Usage; my $help = 0; my $man = 0; GetOptions('help|?' => \$help, man => \$man ) or pod2usage(2); pod2usage(-exitval => 0, -verbose => 1) if $help; pod2usage(-exitval => 0, -verbose => 2) if $man; my $file = shift; pod2usage(-exitfile => 1, -verbose => 1) unless ( defined( $file )); die("File $file is not a regular file.\n") unless ( -f $file );