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 avoid

avoid `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 "");

In reply to Re: Faster replacement of sed commands.. by pvaldes
in thread Faster replacement of sed commands.. by Ankur_kuls

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.