Olof Johansson wrote:
On 2011-03-16 22:51 +0700, ind...@students.itb.ac.id wrote:
if(@ARGV != 1){
print "ARGV error \n";
print "firstradar velx vely \n";
exit(1);
}
...
I got this error message :
ARGV error
firstradar velx vely
This is your output if the number of arguments isn't what you
expected. Guessing from
print "firstradar velx vely \n";
you probably want to change
if(@ARGV != 1){
to
if(@ARGV != 2){
as @ARGV is a list and lists in scalar context is how many elements it
contains.
perldoc -q "What is the difference between a list and an array?"
@ARGV is an ARRAY and ARRAYs in scalar context ...
John
--
Any intelligent fool can make things bigger and
more complex... It takes a touch of genius -
and a lot of courage to move in the opposite
direction. -- Albert Einstein
--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/