Help for this page

Select Code to Download


  1. or download this
    $ cat argvtest.pl
    printf "I saw %d arguments\n",$#ARGV+1; #show how many
    @argsin=@ARGV; # Snarf in the argnuments
     
    printf "They were \"%s\"\n",join(",",@argsin); # and what
    
  2. or download this
    $ perl argvtest.pl 1 2 3 4
    I saw 4 arguments
    
    They were "1,2,3,4"
    
  3. or download this
    if ( $#ARGV < 0 ) { # NOTE: not != 0 
        printf "I expected an argument not simple refutation\n";
        exit(0);
    }
    
  4. or download this
    @RecievedArray=$ARGV[0];
    
  5. or download this
    use Data::Dumper;
     
    ...
    printf "Second array:\n";
    print Dumper(\@ry2);
    
  6. or download this
    First array:
    $VAR1 = [
    ...
    $VAR1 = [
              'a'
            ];