in reply to strawberry win10 no ARGV

Can you please post your code so we can see what you're trying to do, and how?

Strawberry Perl handles command line arguments perfectly fine. Here's an example:

use warnings; use strict; if (@ARGV != 3){ print "Program requires 3 arguments\n"; exit; } my ($one, $two, $three) = @ARGV; print "arg1: $one, arg2: $two, arg3: $three\n";

output:

> perl def.pl Program requires 3 arguments > perl def.pl 1 2 3 arg1: 1, arg2: 2, arg3: 3

If you require anything more elaborate than sending in a small number of simple args, there's the Getopt::Long distribution.

Replies are listed 'Best First'.
Re^2: strawberry win10 no ARGV
by twyce (Initiate) on Dec 14, 2019 at 22:39 UTC
    I am mostly interested in calling from another script. I've tried qx, backticks, and system. So Eventually I tried simply from the command line, like. "scriptname.pl 09 12 34likj" No dice. My code is basically
    my $i = 0 ; for ( @ARGV ) { $i++ ; print "i:$i for argv $_\n" ; } print "$i is the final index of argv\n" ;
    All my scripts work fine in win7 + activeperl

      your file association is wrong. You need %* after the "%1" in the command your association runs.

        I guess you're joking? Anyhow why can't I call one script from another script and send it @ARGV ?