Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Re: Checking for duplicate subroutine names

by flexvault (Parson)
on Oct 12, 2012 at 16:05 UTC ( #998733=note: print w/ replies, xml ) Need Help??


in reply to Checking for duplicate subroutine names

SirBones,

Look at the use of 'package'. I believe that all variables and subroutines are defined by package.

One way to do what you want is name your code as 'package something.pm'. Since your using require to bring the script into your main package, load your package via 'use' at the beginning of execution, and then loop on the require part which will include calls to your subroutines for building the user's script. I would also put the loop in an 'eval'.

Other Perl Monks will have more experience with 'package' (hint: you need it for CPAN). I've only used it once or twice.

Good Luck

"Well done is better than well said." - Benjamin Franklin


Comment on Re: Checking for duplicate subroutine names

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others taking refuge in the Monastery: (6)
As of 2014-08-28 04:56 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The best computer themed movie is:











    Results (256 votes), past polls