Long directory structure on one line
am 15.11.2008 12:22:02 von zilore mumba--===============1646407192==
Content-Type: multipart/alternative; boundary="0-1412090527-1226748122=:24762"
--0-1412090527-1226748122=:24762
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: quoted-printable
Perl Users,
Firstly my apologies for my very elementary knowledge of Perl.
Thanks to ideas from Sena and Mustafa, and a lot of assistance from Bill Lu=
ebkert on an earlier script, I have below a snippet from a script which I t=
ohught should work.
The problem is $base_dir, which is supposed to be
/home/Mumba/archive/11-November08/ukmo/20081115 is being put on several lin=
es as
/home/Mumba/archive/11
-
November08
Hence my chdir ("$base_dir/$dat") gives the error "cannot cd", no such file=
or directory. I have another script which works, with a similar but even l=
onger directory. I do not see the difference.
Is there some trick I can do to force the whole directory on one line?
Thanks
=A0
=A0
my $base_dir=3D"/home/Mumba/archive/$model_mon$dash$mon_name$yr /$model";
#
chdir ("$base_dir/$dat") || die "Sorry, couldn't cd: $!";
my @files =3D<$base_dir/$dat/*>;
foreach my $file (@files) {
print "Catting $file\n" if $debug;
system("/bin/cat @files > $model$cycle$grib_ext") or warn "Failed '$=
file': $! ($^E)";
}
#
system("/usr/bin/perl /usr/local/bin/grib2ctl.pl -verf $model$cycle$grib_ex=
t" > "$model$cycle$ctl_ext");
system("/usr/local/grads/bin/gribmap -i $model$cycle$ctl_ext -v -e");
#
opendir (BASE,"$base_dir/$model/$dat") || die "Cannot open BASE: $!";
while ($file =3D readdir(BASE)) {=20
=A0 system("rm $file)\n") || warn "Having trouble deleting $file: $!"=
;
# unlink($file)
}
closedir(BASE);
=0A
--0-1412090527-1226748122=:24762
Content-Type: text/html; charset=us-ascii
Perl Users, Firstly my apologies for my very elementary knowledge of Perl. Thanks to ideas from Sena and Mustafa, and a lot of assistance from Bill Luebkert on an earlier script, I have below a snippet from a script which I tohught should work. The problem is $base_dir, which is supposed to be /home/Mumba/archive/11-November08/ukmo/20081115 is being put on several lines as /home/Mumba/archive/11 - November08 Hence my chdir ("$base_dir/$dat") gives the error "cannot cd", no such file or directory. I have another script which works, with a similar but even longer directory. I do not see the difference. Is there some trick I can do to force the whole directory on one line? Thanks my $base_dir="/home/Mumba/archive/$model_mon$dash$mon_name$yr/$ model"; # chdir ("$base_dir/$dat") || die "Sorry, couldn't cd: $!"; my @files =<$base_dir/$dat/*>; foreach my $file (@files) { print "Catting $file\n" if $debug; system("/bin/cat @files > $model$cycle$grib_ext") or warn "Failed '$file': $! ($^E)"; } # system("/usr/bin/perl /usr/local/bin/grib2ctl.pl -verf $model$cycle$grib_ext" > "$model$cycle$ctl_ext"); system("/usr/local/grads/bin/gribmap -i $model$cycle$ctl_ext -v -e"); # opendir (BASE,"$base_dir/$model/$dat") || die "Cannot open BASE: $!"; while ($file = readdir(BASE)) { system("rm $file)\n") || warn "Having trouble deleting $file: $!"; # unlink($file) } closedir(BASE); |
--0-1412090527-1226748122=:24762--
--===============1646407192==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
_______________________________________________
ActivePerl mailing list
ActivePerl@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
--===============1646407192==--