Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Re: Calling Perl from Perl

by broquaint (Abbot)
on Dec 04, 2002 at 14:25 UTC ( [id://217486]=note: print w/replies, xml ) Need Help??


in reply to Calling Perl from Perl

Is there an easy way to call Perl scripts from within a Perl script and keep the environment variables?
I'm not sure how well this will work on your Window box but you could fork() then exec() your external scripts e.g
@ENV{qw/ one two three /} = qw( foo bar baz ); exec "perl somescript.pl" if fork();
Or you could just do() them in a separate package e.g
{ package RandomPkgName; do "somescript.pl"; }
The package declaration will avoid cluttering up your current namespace.
HTH

_________
broquaint

Log In?
Username:
Password:

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

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

    No recent polls found