Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

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

by Flexx (Pilgrim)
on Sep 18, 2002 at 16:17 UTC ( #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
Node Status?
node history
Node Type: note [id://198894]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (9)
As of 2021-03-02 20:37 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My favorite kind of desktop background is:











    Results (62 votes). Check out past polls.

    Notices?