>>>>> "i" == indrag  <ind...@students.itb.ac.id> writes:

  i> #!/usr/bin/perl

  i> use NetCDF;

use strict ;
use warnings ;

those ask perl to help you. always use them. you will have to declare
all your vars with my when using strict but that is the point.


  i> if(@ARGV == 6){

that makes no sense. you look for 6 args in @ARGV just below but if you
pass in 6 args on the commane line you print an error. it should be !=
to make sure you get 6 args.

  i>     print "ARGV ERROR \n";
  i>     print "date hhmm Noise Radius AZ1 AZ2\n";

is your program called date? that is already a standard unix command so
don't use that name. if date is an argument then you should also show
the command name in the usage. make the ARGV error say what the error
is (wrong number of arguments). 

  i>     exit(1);
  i> }
  i> $date   = $ARGV[0];
  i> $hhmn   = $ARGV[1];
  i> $opt_Noise = $ARGV[2];
  i> $radius = $ARGV[3];
  i> $AZ1    = $ARGV[4];
  i> $AZ2    = $ARGV[5];


  i> open(FP,"list");

why do you open and then immediately close the file? also you should
always check for success/failure when opening files.

        open( FP, 'list' ) or die "can't open 'list': $!" ;

  i> while(defined($file = <FP>)){

good that you used defined there but in recent perls that is always done
with the while $file = <FP> idiom.

  i>     chomp($file);
  i>     $orgF = "${work}/${file}";
  i>     system("mkdir -p ${unfold}");

perl has mkdir builtin. File::Path (a core module) has mkpath which is
the same as mkdir -p.

  i>     print "$orgF \n";

  i> #######  FILE NAME CHANGE for minimum time ###########
  i>     system("cp $orgF test.nc");

you don't need to system call out for that. there is a File::Copy
module.

there is too much module specific code in the rest for me to comment.

uri

-- 
Uri Guttman  ------  u...@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-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/


Reply via email to