On 3/16/11 Wed  Mar 16, 2011  8:51 AM, "ind...@students.itb.ac.id"
<ind...@students.itb.ac.id> scribbled:

> 
> Hi, I am Indra. I am new in perl.
> 
> I start to run my script :
> ******************************************************************************
> *******************
> #!/usr/bin/perl -w
> 
> $UNFOLD  = 1; #1=UNFOLD^[$B%G!<%?$r;HMQ^[(B
> 0=^[$B@8^[(Bvolume^[$B%G!<%?$r;HMQ^[(B
> $XDR_NUM = 1; #1=^[$BJRJ}$N$_^[(BCAPPI^[$B$r:n@.^[(B
> 0=^[$BN>J}$N^[(BCAPPI^[$B$r:n@.^[(B
> 
> # work directory #
> $workdir = "..";
> $datadir = "../volume";
> $year    = "2011";
> 
> if(@ARGV != 1){
>     print "ARGV error \n";
>     print "firstradar velx vely \n";
>     exit(1);
> }
> ......
> 
> ******************************************************************************
> *******************
> I got this error message :
> ARGV error 
> firstradar velx vely
> 
> 
> please help me, how to overcame this.

Your script requires that one argument be entered on the command line, like
this:

    yourscript.pl arg1

Arguments entered this way are put into the @ARGV array. The logical
expression (@ARGV != 1) compares the number of elements in the @ARGV array
to 1 and returns true if they are not equal. An array in scalar context like
the above use returns the number of elements in the array.

Therefore, you should enter one argument on the command line when you
execute the script.



-- 
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