Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Re: Running Perl program using backquotes

by mothra (Hermit)
on Apr 18, 2001 at 03:20 UTC ( #73387=note: print w/replies, xml ) Need Help??


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;

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others exploiting the Monastery: (5)
As of 2022-05-18 14:22 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Do you prefer to work remotely?



    Results (71 votes). Check out past polls.

    Notices?