Beefy Boxes and Bandwidth Generously Provided by pair Networks httptech
Perl: the Markov chain saw
 
PerlMonks  

Re: Trouble finding a subroutine

by fauria (Deacon)
on Jan 06, 2005 at 13:34 UTC ( [id://420019]=note: print w/replies, xml ) Need Help??

This is an archived low-energy page for bots and other anonmyous visitors. Please sign up if you are a human and want to interact.


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";

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://420019]
help
Sections?
Information?
Find Nodes?
Leftovers?
    Notices?
    hippoepoptai's answer Re: how do I set a cookie and redirect was blessed by hippo!
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.