Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer

Re: how to access the commandline arguments?

by crabbdean (Pilgrim)
on May 01, 2004 at 09:42 UTC ( #349590=note: print w/ replies, xml ) Need Help??

Help for this page

Select Code to Download

  1. or download this
    my $count = @ARGV;
    print $count;
  2. or download this
    if (@ARGV < 3) {
            die "use: script var1 var2 var3\n";
            my ($var1, $var2, $var3) = @ARGV;
    ## then use $var1, $var2 and $var3 in your program
  3. or download this
    my ($stream, $path, $rturn, $depth, $display) = @ARGV;
    $stream = \*STDOUT unless @_ > 0;
    $rturn = 'all' unless @_ > 2;
    $depth = -1 unless @_ > 3;
    $display = 'rel_file' unless @_ > 4;
  4. or download this
    my $nextvar = shift @ARGV;
  5. or download this
    for my $this (@ARGV) {
           print "$this\n";
  6. or download this
    while (<>) {
               print "$_\n";

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://349590]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (3)
As of 2015-11-29 06:20 GMT
Find Nodes?
    Voting Booth?

    What would be the most significant thing to happen if a rope (or wire) tied the Earth and the Moon together?

    Results (747 votes), past polls