Hi
I'm trying to get the 3rd parameter to the last parameter put into a scalar variable.
I then want to split the scalar var(no problems here though..)
This is not working..
If i run this like so..
perl prog.pl useless useless var:i:want:up until this
$var prints out as only 'this'
I want $var to be 'var:i:want:up until this'
I don't know how many parameters are going to be sent to the command line.. I do want them all though, hence the need to use something like $#ARGV
is this possible..?
----
Of All the things I've lost in my life it's my mind I miss the most.
I'm trying to get the 3rd parameter to the last parameter put into a scalar variable.
I then want to split the scalar var(no problems here though..)
This is not working..
Code:
$var = @ARGV[2..$#ARGV];
print $var;
If i run this like so..
perl prog.pl useless useless var:i:want:up until this
$var prints out as only 'this'
I want $var to be 'var:i:want:up until this'
I don't know how many parameters are going to be sent to the command line.. I do want them all though, hence the need to use something like $#ARGV
is this possible..?
----
Of All the things I've lost in my life it's my mind I miss the most.