in reply to Faster replacement of sed commands..
unrelated with the topic, but perhaps useful to make your script a little faster:
you could want to put the whole "/data/admin/scsripts/SapcmedadpebM/xdecoder/decodedir" thing in a var. The purpose of this is to avoid typing mistakes and to write shorter sentences easier to debug. Something like: (untested).
my $path = "/very/long/path/here"; # or maybe: opendir(my $path, "/very/long/path/here"); move($abc1,"$path/compleat/"); foreach my $file (<$path/MHSAPC/*csv>){chomp; ... ## read also about +glob
You probably don't need to use the touch line here, just open the file. Open avoids you later the need for an one-liner inside a perl script, (bad style to me, you are opening two perl processes and the second is not necessary)
`perl -i -pe 's/[^[:ascii:]]//g; tr/\015//d' $abc1`; ## to avoidavoid `find -mmin ...`, use stat instead:
$mmtime = (stat($file))[9]; if ($mmtime > 600){do something ....} ; ## note that these are seconds, 10 min = 600 sec
if ($abc1 eq "") { next; }
No need to spend four lines for this, probably:
next if ($abc1 eq "");
|
---|