G'day hadrons,

Welcome to the Monastery.

As already pointed out, there are incompatibilities between Unix commands, MS commands and Perl functions; e.g. rm (Unix), erase (MS), unlink (Perl).

If speed is all-important, you may have to write separate name.sh and name.bat scripts.

Perl can do everything in your examples without system. For instance, take a look at open which has examples of reading from and writing to files; glob which can expand wild cards like *.xml; and the core File::Copy module which has a move() function.

Your description of "File::Grep" is not the way to go here (even if it does have some basis in fact). You've provided no code, no context, and no Benchmark! Instead, you should provide those things and ask us how you might improve speed efficiency. I've never used File::Grep so I just looked it up: it's 16 years old; a better option may have been produced since it was written.

— Ken


In reply to Re: Using system (); with Strawberry Perl by kcott
in thread Using system (); with Strawberry Perl by hadrons

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.