Help for this page

Select Code to Download


  1. or download this
    @ECHO OFF
    SetLocal EnableDelayedExpansion
    ...
    )
    
    call perl getargs.pl %ARGS%
    
  2. or download this
    unshift(@ARGV,$0);
    for my $n (0..$#ARGV) { print "$n:$ARGV[$n]:\n" }
    
  3. or download this
    C:\>parseargs.bat "abc "" def" bob
    0:getargs.pl:
    1:"abc "" def":
    2:bob:
    
  4. or download this
    unshift(@ARGV,$0);
    @ARGV = map {s/^"(.*)"$/$1/ ? s/""/"/g && $_ : $_ } @ARGV;
    for my $n (0..$#ARGV) { print "$n:$ARGV[$n]:\n" }
    
  5. or download this
    0:getargs.pl:
    1:abc " def:
    2:bob: