in reply to Trouble finding a subroutine

Hi!

Im new to perlmonks, and also ive not been using perl for as much time as other people here, so this may not be as accurate as it could. Anyway, here is what i usually do:

sub help{ print "Whatever youd like to write\n"; return; } die &help unless scalar(@ARGV) == 1;


Or, alternatively:

use strict; use Getopt::Long; my $var; sub usage{ print "Usage: $0 --foo=bar\n"; return; } GetOptions("foo=s" => \$var) and defined($var) or die &usage; print "You typed: $var\n";