zilore mumba wrote: > > The files in "/home/Mumba/archive/11-November08/ukmo/20081120" have been > concatenated and written to $ofile (ukmo00.grb) which is still in > "/home/Mumba/archive/11-November08/ukmo". > $ofile has to be moved into the date directory because the next day a > new $ofile will be created with the same name and will replace the one > created the previous day. > I tried the code below for moving $ofile from: > "/home/Mumba/archive/11-November08/ukmo" > to > "/home/Mumba/archive/11-November08/ukmo/20081120"
Just move it: rename "$base_dir/$ofile", "$base_dir/ukmo/$dat" or ... die stuff here > The file does not move (and no error is indicated). > Assistance please. > opendir DIR, "$base_dir" or die "opendir '$base_dir' Failed: $! ($^E)"; > while (my $file=readdir DIR) { > next if $file="$model$cycle$grib_ext"; > while (<$file>) { rename "$file", "$base_dir/$dat" or warn "rename > '$file' failed: $! ($^E)";} > } > closedir DIR; > # _______________________________________________ ActivePerl mailing list ActivePerl@listserv.ActiveState.com To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs