Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re: Using system (); with Strawberry Perl

by kcott (Archbishop)
on Nov 25, 2021 at 05:54 UTC ( [id://11139101]=note: print w/replies, xml ) Need Help??


in reply to Using system (); with Strawberry Perl

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

Replies are listed 'Best First'.
Re^2: Using system (); with Strawberry Perl
by hadrons (Novice) on Nov 25, 2021 at 22:24 UTC
    I did get better results from File::Grep when I changed from fgrep to just grep

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://11139101]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others taking refuge in the Monastery: (3)
As of 2024-04-20 03:34 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found