Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re: Command Terminal: system(), exec() etc query

by lyklev (Pilgrim)
on Jan 28, 2011 at 15:51 UTC ( [id://884865]=note: print w/replies, xml ) Need Help??


in reply to Command Terminal: system(), exec() etc query

Without knowing too much about your problem, I think you need

system("./DynDom $filename")

This will print the output of your program DynDom to the screen; you don't seem to want to capture the output in a variable, but if you do, you can then use

my $output = `./DynDom $filename`;

Exec is more tricky because it does not return to perl, it stops your program (in this case Perl), replaces perl with the program executed, then starts the new program. This means that it will do the first iteration in the loop, run your program and then exit.

When you need exec(), you will know when you need it...

Log In?
Username:
Password:

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

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

    No recent polls found