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

Popular posts from this blog

html - Outlook 2010 Anchor (url/address/link) -

javascript - Why does running this loop 9 times take 100x longer than running it 8 times? -

Getting gateway time-out Rails app with Nginx + Puma running on Digital Ocean -