On 11-03-16 12:11 PM, shawn wilson wrote:
On Mar 16, 2011 11:53 AM,<ind...@students.itb.ac.id>  wrote:


if(@ARGV != 1){


I don't think you can look at an array like its a string like that.
Maybe string( @ARGV ) != 1 might work. But what you probably want is:
If( defined( $ARGV[ 0 ] ) )


No, that is correct. In scalar context, @array is the number of items in the array. The problem is that the OP is running the script without any arguments.

On 11-03-16 11:51 AM, ind...@students.itb.ac.id wrote:
> if(@ARGV != 1){
>      print "ARGV error \n";
>      print "firstradar velx vely \n";
>      exit(1);
> }

This code will print out an error and stop the script if there are no arguments. Solution: run the script with arguments.


--
Just my 0.00000002 million dollars worth,
  Shawn

Confusion is the first step of understanding.

Programming is as much about organization and communication
as it is about coding.

The secret to great software:  Fail early & often.

Eliminate software piracy:  use only FLOSS.

--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/


Reply via email to