in reply to Break up command line

I thought when you execute the script it automatically puts it in @_. So when you first start the script you can
$firstele = shift; $secondele = shift; $thirdele = shift;
or you can do it this was
my ($first, $second, $third) = @_;
so if you run a command like this
myscript.pl "this is a test" what is it
$first = "this is a test" $second = "what" $third = "is"

does this help?

Replies are listed 'Best First'.
(jeffa) 2Re: Break up command line
by jeffa (Bishop) on Jun 02, 2001 at 02:39 UTC
    Almost, you want @ARGV, not @_

    Jeff

    R-R-R--R-R-R--R-R-R--R-R-R--R-R-R--
    L-L--L-L--L-L--L-L--L-L--L-L--L-L--
    
      interesting. @_ works on sco, and (caldera, red hat) linux.
        Actually... shift works on @ARGV outside of subroutines, and on @_ inside subroutines. Looks exactly the same though.