Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Tutorial on arguments for the new

by Andrew_Levenson (Hermit)
on Dec 11, 2006 at 21:03 UTC ( [id://589150]=perlmeditation: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    use strict; #always and forever, amen.
    use warnings;  #or else.
    
    ...
    #@ARGV is an array containing the arguments supplied. We're taking the
    + first value.
    print "\n$argument"; 
    #This here will show you exactly what has been put into $argument.
    
  2. or download this
    
    $bar='Hello,';
    ...
    #will first print out the contents of $bar, then $baz because 
    #those are the arguments given.
    }
    
  3. or download this
    foo("square", 3);
    
    sub foo{
      my ($shape, $size) = @_;
    }
    
  4. or download this
    
    
    
    C(qw/74 97 104 112/);sub C{while(@_){$c**=$C;print
    (map{chr($C!=$c?shift:pop)}$_),$C+=@_%2!=1?1:0}}
    

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlmeditation [id://589150]
Approved by Joost
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others chilling in the Monastery: (4)
As of 2024-04-25 20:15 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found