in reply to Running Perl program using backquotes

Also keep in mind that backticks are only used when you want to capture the output of the program you run within them.

From perlfaq8:

What's wrong with using backticks in a void context?

Strictly speaking, nothing. Stylistically speaking, it's not a good way to write maintainable code because backticks have a (potentially humongous) return value, and you're ignoring it. It's may also not be very efficient, because you have to read in all the lines of output, allocate memory for them, and then throw it away.

Note that backticks return whatever the program that's run with them sends to STDOUT. Considering that you're redirecting STDOUT to a file here, you're probably better off using system.

Replies are listed 'Best First'.
Re: Re: Running Perl program using backquotes
by nysus (Parson) on Apr 18, 2001 at 05:38 UTC
    More food for thought...thanks. I will definitely read up on these funky functions.

    $PM = "Perl Monk's";
    $MCF = "Most Clueless Friar;
    $nysus = $PM . $MCF;