Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re: Error when using system("clear") command

by andreas1234567 (Vicar)
on Jul 17, 2007 at 14:20 UTC ( [id://627032]=note: print w/replies, xml ) Need Help??


in reply to Error when using system("clear") command

Is it possible to capture the output of the command to a variable first, then act depending on the whether the variable is defined or not?
use strict; use warnings; use Fatal qw(open close); # make open, close die on failure if($version eq "XP") { my $success = `wmdist -e $input SUCCESS`; if ($success) { my $FH = undef; open($FH, "> XP_success.txt"); print $FH, $success; close $FH; } else { # no output from success command } }
The backtick operator is described in perlop.
--
Andreas

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others lurking in the Monastery: (2)
As of 2024-04-20 04:21 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found