Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re^5: Perl script error

by talexb (Chancellor)
on Apr 22, 2016 at 15:20 UTC ( [id://1161233]=note: print w/replies, xml ) Need Help??


in reply to Re^4: Perl script error
in thread Perl script error

Where are lines 52 and 54? Where are you outputting "Something's wrong"?

Alex / talexb / Toronto

Thanks PJ. We owe you so much. Groklaw -- RIP -- 2003 to 2013.

Replies are listed 'Best First'.
Re^6: Perl script error
by sellinios (Initiate) on Apr 22, 2016 at 20:15 UTC
    #!/usr/bin/perl -w use Class::Date qw(date now); use File::Path; use File::Copy; use List::Util qw(min max); use DateTime; $start_time = DateTime->now(); $region = 'greece-9km'; $lrun = '32'; chomp( $flag = $ARGV[0] ); if ( $flag =~ m/^(00|06|12|18)$/ ) { $hh = $flag; chomp( $yyyymmdd = `date +%Y%m%d` ); $yymmdd = substr( $yyyymmdd, 2, 6 ); $real_time = 1; } elsif ( $flag =~ m!^(19|20)\d\d(0[1-9]|1[012])(0[1-9]|[12][0-9]|3[01])(00|06|12|18) +$! ) { $yyyymmdd = substr( $flag, 0, 8 ); $yymmdd = substr( $yyyymmdd, 2, 6 ); $hh = substr( $flag, 8, 2 ); $real_time = 1; } $yyyymmddhh = $yyyymmdd . $hh; $Class::Date::DATE_FORMAT = "%Y%m%d%H"; $data_inici = date $yyyymmddhh. "0000"; $data_gfs = $data_inici - '6 h'; $rm_wrf_maps = $data_inici - '192 h'; $root = '/home/meteo/Build_WRF'; $gfsdir = "$root/SCRIPTS"; $wrfdir = "$root/SCRIPTS"; $gfsdat = "$root/DATA/GFS"; $wrfdat = "$root/DATA/WRF/$region"; @args = ("rm -rf $gfsdat/*"); system(@args) == 0 or warn; @args = ("rm -rf $wrfdat/*"); system(@args) == 0 or warn; @doms = ( 'europe-27km', 'greece-9km' ); foreach (@doms) { $domain = $_; $wrfmap = "$root/DATA/MAPS/$domain"; @args = ("rm -r $wrfmap/$rm_wrf_maps"); system(@args) == 0 or warn; } @args = ("$gfsdir/get_gfs_30min.pl $data_gfs"); system(@args) == 0 or warn; @args = ("$wrfdir/autorun.WRF.v3.pl $region $lrun $data_inici"); system(@args) == 0 or warn; @args = ("$wrfdir/plot.maps.v2.pl $region $lrun $data_inici"); system(@args) == 0 or warn; @args = ("touch $wrfmap/$data_inici/ready"); system(@args) == 0 or warn; #@args = ("rm -r $gfsdat/*"); #system(@args) == 0 or warn; #@args = ("rm -r $wrfdat/*"); #system(@args) == 0 or warn; print("STOP"); $end_time = DateTime->now; $elapse = $end_time - $start_time; print "Elapsed time : ".$elapse->in_units('minutes')."m\n"; exit;
      Try printing each string first before calling system on it. The strings on lines 51 and 53 don't finish successfully. You should also change
      system(@args) == 0 or warn;

      to

      system(@args) == 0 or warn $?;

      as system doesn't populate $@ which is the default argument of warn.

      ($q=q:Sq=~/;[c](.)(.)/;chr(-||-|5+lengthSq)`"S|oS2"`map{chr |+ord }map{substrSq`S_+|`|}3E|-|`7**2-3:)=~y+S|`+$1,++print+eval$q,q,a,

      Thanks for posting more code. I still have no idea where the problem lines are, or where your error code is coming from. Good luck! :)

      Alex / talexb / Toronto

      Thanks PJ. We owe you so much. Groklaw -- RIP -- 2003 to 2013.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1161233]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others wandering the Monastery: (3)
As of 2024-03-28 18:05 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found