help me for this error

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 [at] 8^[(Bvolume^[$B%G!<%?$r;HMQ^[(B
#$XDR_NUM = 1; #1=^[$BJRJ}$N$_^[(BCAPPI^[$B$r:n [at] .^[(B 0=^[$BN>J}$N^[(BCAPPI^[$B$r:n [at] .^[(B

# work directory #
$workdir = "/work/radar_mkCAPPI";
$datadir = "/work/radar_mkCAPPI/volume";
$year = "2010";

if( [at] 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 [at] perl.org
For additional commands, e-mail: beginners-help [at] perl.org
http://learn.perl.org/
indrag [ Mi, 18 Mai 2011 11:25 ] [ ID #2059650 ]

Re: help me for this error

On Wed, May 18, 2011 at 2:55 PM, <indrag [at] students.itb.ac.id> wrote:
> ARGV error
> firstradar velx vely
>
>
> if( [at] 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



--
Thank you
Balachandran Sivakumar

Arise Awake and stop not till the goal is reached.

Mail: benignbala [at] gmail.com
Blog: http://benignbala.wordpress.com/

--
To unsubscribe, e-mail: beginners-unsubscribe [at] perl.org
For additional commands, e-mail: beginners-help [at] perl.org
http://learn.perl.org/
Balachandran Sivakuma [ Mi, 18 Mai 2011 11:37 ] [ ID #2059651 ]

Re: help me for this error

Try something like
if(scalar( [at] 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... [at] gmail.com (Balachandran Sivakumar)
wrote:
> On Wed, May 18, 2011 at 2:55 PM, =A0<ind... [at] students.itb.ac.id> wrote:
> > ARGV error
> > firstradar velx vely
>
> > if( [at] 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... [at] gmail.com
> Blog:http://benignbala.wordpress.com/


--
To unsubscribe, e-mail: beginners-unsubscribe [at] perl.org
For additional commands, e-mail: beginners-help [at] perl.org
http://learn.perl.org/
saran [ Mi, 18 Mai 2011 15:00 ] [ ID #2059656 ]

Re: help me for this error

>>>>> "S" == Saran <mail2saravanan [at] gmail.com> writes:

S> Try something like
S> if(scalar( [at] ARGV) != 3) {

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

uri

--
Uri Guttman ------ uri [at] 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 [at] perl.org
For additional commands, e-mail: beginners-help [at] perl.org
http://learn.perl.org/
Uri Guttman [ Mi, 18 Mai 2011 18:46 ] [ ID #2059657 ]

Re: help me for this error

On Wednesday 18 May 2011 12:25:52 indrag [at] 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 [at] 8^[(Bvolume^[$B%G!<%?$r;HMQ^[(B #$XDR_NUM = 1;
> #1=^[$BJRJ}$N$_^[(BCAPPI^[$B$r:n [at] .^[(B 0=^[$BN>J}$N^[(BCAPPI^[$B$r:n [at] .^[(B
>
> # work directory #
> $workdir = "/work/radar_mkCAPPI";
> $datadir = "/work/radar_mkCAPPI/volume";
> $year = "2010";
>
> if( [at] 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 [at] perl.org
For additional commands, e-mail: beginners-help [at] perl.org
http://learn.perl.org/
Shlomi Fish [ Mi, 18 Mai 2011 19:43 ] [ ID #2059659 ]
Perl » gmane.comp.lang.perl.beginners » help me for this error

Vorheriges Thema: concatenate a hash key
Nächstes Thema: word boundry