help me for this error

help me for this error

am 18.05.2011 11:25:52 von indrag

Dear all,

I try to run this script to process my radar data, the script build by someone, I have asked him, but his advice can not help. This error message :
ARGV error
firstradar velx vely

This is the Perl code:

#! /usr/bin/perl

$UNFOLD = 0; #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 = "/work/radar_mkCAPPI";
$datadir = "/work/radar_mkCAPPI/volume";
$year = "2010";

if(@ARGV != 3){
print "ARGV error \n";
print "firstradar velx vely \n";
exit(1);
}

### NAME your RADARs #############
$Rname1 = "bandung"; #radar name
#$Rname2 = "Serpong"; #radar name

#### Setting option of CAPPI #####
$firstradar = $ARGV[0];
$velx = $ARGV[1];
$vely = $ARGV[2];


## Save as temporary data? ##
## yes => 1 or no => 0 ##
## narita => 0 , ##
## haneda => 1 , ##
## cmp =>2 ##
#############################


if($firstradar eq $Rname1){
$RADARnameF = $Rname1;
# $RADARnameS = $Rname2;
$FX = 0.0;


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

Re: help me for this error

am 18.05.2011 11:37:00 von Balachandran Sivakumar

On Wed, May 18, 2011 at 2:55 PM, wrote:
> ARGV error
> firstradar velx vely
>
>
> if(@ARGV !=3D 3){
> =A0 =A0print "ARGV error \n";
> =A0 =A0print "firstradar velx vely \n";
> =A0 =A0exit(1);
> }

From what I see, this script expects command line arguments
and expects 3 arguments. So, you should run it something like

../script_name 0 1 2

Or whatever the appropriate value is for firstradar, velx and vely. Thanks



--=20
Thank you
Balachandran Sivakumar

Arise Awake and stop not till the goal is reached.

Mail: benignbala@gmail.com
Blog: http://benignbala.wordpress.com/

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

Re: help me for this error

am 18.05.2011 15:00:31 von saran

Try something like
if(scalar(@ARGV) !=3D 3) {


The above statement will execute if there is less than or greater than
three command line arguments..

~ Saran

On May 18, 2:37=A0pm, benignb...@gmail.com (Balachandran Sivakumar)
wrote:
> On Wed, May 18, 2011 at 2:55 PM, =A0 wrote:
> > ARGV error
> > firstradar velx vely
>
> > if(@ARGV !=3D 3){
> > =A0 =A0print "ARGV error \n";
> > =A0 =A0print "firstradar velx vely \n";
> > =A0 =A0exit(1);
> > }
>
> From what I see, this script expects command line arguments
> and expects 3 arguments. So, you should run it something like
>
> ./script_name 0 1 2
>
> Or whatever the appropriate value is for firstradar, velx and vely. Thank=
s
>
> --
> Thank you
> Balachandran Sivakumar
>
> Arise Awake and stop not till the goal is reached.
>
> Mail: benignb...@gmail.com
> Blog:http://benignbala.wordpress.com/


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

Re: help me for this error

am 18.05.2011 18:46:12 von Uri Guttman

>>>>> "S" == Saran writes:

S> Try something like
S> if(scalar(@ARGV) != 3) {

there is no need for scalar there. the != op provides a scalar context
so @ARGV will return its count.

uri

--
Uri Guttman ------ uri@stemsystems.com -------- http://www.sysarch.com --
----- Perl Code Review , Architecture, Development, Training, Support ------
--------- Gourmet Hot Cocoa Mix ---- http://bestfriendscocoa.com ---------

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

Re: help me for this error

am 18.05.2011 19:43:42 von Shlomi Fish

On Wednesday 18 May 2011 12:25:52 indrag@students.itb.ac.id wrote:
> Dear all,
>
> I try to run this script to process my radar data, the script build by
> someone, I have asked him, but his advice can not help. This error message
> : ARGV error
> firstradar velx vely
>
> This is the Perl code:
>
> #! /usr/bin/perl
>

No "use strict;" - no "use warnings;" and lots of other offending stuff - this
script is horrible.

Please don't use it, and instead learn Perl properly from the resources on
http://perl-begin.org/ and then re-implement the script the right way.
Alterantively, you can hire someone to write your script for you -
http://jobs.perl.org/ .

Regards,

Shlomi Fish

> $UNFOLD = 0; #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 = "/work/radar_mkCAPPI";
> $datadir = "/work/radar_mkCAPPI/volume";
> $year = "2010";
>
> if(@ARGV != 3){
> print "ARGV error \n";
> print "firstradar velx vely \n";
> exit(1);
> }
>
> ### NAME your RADARs #############
> $Rname1 = "bandung"; #radar name
> #$Rname2 = "Serpong"; #radar name
>
> #### Setting option of CAPPI #####
> $firstradar = $ARGV[0];
> $velx = $ARGV[1];
> $vely = $ARGV[2];
>
>
> ## Save as temporary data? ##
> ## yes => 1 or no => 0 ##
> ## narita => 0 , ##
> ## haneda => 1 , ##
> ## cmp =>2 ##
> #############################
>
>
> if($firstradar eq $Rname1){
> $RADARnameF = $Rname1;
> # $RADARnameS = $Rname2;
> $FX = 0.0;

--
------------------------------------------------------------ -----
Shlomi Fish http://www.shlomifish.org/
Rethinking CPAN - http://shlom.in/rethinking-cpan

Real men don't listen to sentences that start with "Real men don't".
-- http://whatsup.org.il/article/6023

Please reply to list if it's a mailing list post - http://shlom.in/reply .

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