Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re: Exec script within script or import sub...? help plz

by hbo (Monk)
on Jun 21, 2004 at 02:36 UTC ( #368355=note: print w/ replies, xml ) Need Help??


in reply to Exec script within script or import sub...? help plz

do will "do" this.
Two files, one named "priv" and one named "unpriv". Their contents:
priv:

sub priv { print "Privileged\n"; }

unpriv:
sub priv { print "Unprivileged\n"; }

Now, in your main program, you can:
#!/usr/bin/perl do "unpriv"; priv(); do "priv"; priv();

Which when run:
> perl main Privileged Unprivileged >


Comment on Re: Exec script within script or import sub...? help plz
Select or Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (3)
As of 2014-10-26 00:20 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    For retirement, I am banking on:










    Results (149 votes), past polls