- or download this
#! /usr/local/bin/perl -w
print "Hello, world\n";
- or download this
#! /usr/local/bin/perl -w
use strict;
my $thing = shift(@ARGV);
print "Hello, $thing\n";
- or download this
#! /usr/local/bin/perl -w
use strict;
my $thing = shift;
print "Hello, $thing\n";
- or download this
#! /usr/local/bin/perl -w
use strict;
my $thing = shift || 'world';
print "Hello, $thing\n";
- or download this
#! /usr/local/bin/perl -w
use strict;
my $thing = shift or die "Nothing specified on the command line.\n";
print "Hello, $thing\n";
- or download this
my $thing = shift || 'default';
- or download this
my $thing = shift;
$thing ||= 'default' unless defined $thing;
- or download this
#! /usr/local/bin/perl -w
use strict;
...
$switch = undef if $switch;
}
print $switch ? 'Goodbye' : 'Hello', ", $thing\n";
- or download this
#! /usr/local/bin/perl -sw
use strict;
use vars qw/$g/;
my $thing = shift || 'world';
print $g ? 'Goodbye' : 'Hello', ", $thing\n";
- or download this
#! /usr/local/bin/perl -w
use strict;
...
getopt('g');
my $thing = shift || 'world';
print $opt_g ? 'Goodbye' : 'Hello', ", $thing\n";
- or download this
#! /usr/local/bin/perl -w
use strict;
...
getopt('g', \%args);
my $thing = shift || 'world';
print $args{g} ? 'Goodbye' : 'Hello', ", $thing\n";
- or download this
Getopt::Mixed::init( 'j=s l:s p=i s=s t=s logfile>l d>p date>p period>
+p project>
j type>t');
- or download this
while( my( $option, $value, $pretty ) = Getopt::Mixed::nextOption()
+) {
OPTION: {
...
}
Getopt::Mixed::cleanup();
die "No project specified via -j.\n" unless $Project;