http://qs321.pair.com?node_id=1135018


in reply to Re: How to handle metacharacters in input file for Perl one-liner code
in thread How to handle metacharacters in input file for Perl one-liner code

Hello Dean,

Thanks for your reply.

I should probably have mentioned that I'm running this code inside an iterative loop, so am a bit concerned with execution time. I did consider going this approach instead of a system call, but honestly I have no idea which one would be a more cpu intensive process in terms of file open operations. Would you have any thoughts on that?

Replies are listed 'Best First'.
Re^3: How to handle metacharacters in input file for Perl one-liner code
by AnomalousMonk (Archbishop) on Jul 16, 2015 at 16:56 UTC

    Shelling out to the OS is a very expensive process. If you're really concerned about execution time, do it all in Perl.


    Give a man a fish:  <%-(-(-(-<

Re^3: How to handle metacharacters in input file for Perl one-liner code
by Laurent_R (Canon) on Jul 16, 2015 at 16:57 UTC
    A pure Perl solution is likely to be faster than shelling out to the OS.