Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Re: Running Perl program using backquotes

by mothra (Hermit)
on Apr 18, 2001 at 03:20 UTC ( [id://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?Last hourOther CB clients
Other Users?
Others cooling their heels in the Monastery: (4)
As of 2024-04-25 09:11 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found