in reply to Re: works on command line, but not from perl
in thread works on command line, but not from perl

Thank you. This is part of a much larger bash script that I'm porting. Yes doing it in entirely in perl was the long term goal, but in the first instance, I just wanted to get it running, even using system calls, as it saved me time (or so I thought).
  • Comment on Re^2: works on command line, but not from perl

Replies are listed 'Best First'.
Re^3: works on command line, but not from perl
by graff (Chancellor) on Feb 12, 2010 at 02:59 UTC
    This is part of a much larger bash script that I'm porting.

    Then one of the first things you should be doing is understanding what the shell script was trying to do, instead of just wrapping "system()" calls around things.

    The idea is the get the same things done with code that is shorter, more efficient, easier to understand, and more resilient to a wider range of edge and error conditions. Using four independent processes in a system call just to get a line count on a file (or things to that effect) seems like the wrong way to go about it.