Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re: Open a .pl file form a .pl file (use do)

by Flexx (Pilgrim)
on Sep 18, 2002 at 16:17 UTC ( [id://198894]=note: print w/replies, xml ) Need Help??


in reply to Open a .pl file form a .pl file

If you want to execute an external perl script, you can use the

do EXPR

command (check your perldoc -f do).

This will evaluate EXPR and take it's result as the filename to execute.

You should not use qx`` (backticks), unless you need to pass arguments, or need control over the scripts output. It's more expensive than just do-ing the script. Apart from the pipeing overhead, calling the other script using backticks would start another perl instance to run it -- which will demand extra memory, of course.

Same applies to opening a pipe to the external script, the way kabel sugested. Update: You only want to use pipes if you need to input to the other script's STDIN.

So long,
Flexx

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others surveying the Monastery: (4)
As of 2024-04-23 19:38 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found