Command line argument variable @ARGV in Perl -
i blank perl. have task convert script perl powershell. requesting kind answers. read command line argument of perl @argv. understand @ time of perl script execution argument passed captured special array variable in perl. can read @argv , assign values scalar variable using below
($var1,$var2) = @argv;
i need understand below statement doing
($var1,$var2,@argv) = @argv;
in perl script have if condition on values in @argv , based on @argv values respective subroutine getting called.
as per understanding if have more 2 values in @argv on left side in parenthesis statement changing values of argv/used rewrite @argv remaining values?
please me understand simple example.
thanks ravi
it chops off first 2 arguments @argv , puts them in $var1 , $var2.
personally have written as:
$var1 = shift @argv; $var2 = shift @argv;
but matter of taste.
Comments
Post a Comment