Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask

Re: Checking for duplicate subroutine names

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

in reply to Checking for duplicate subroutine names


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'. 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?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://998733]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others lurking in the Monastery: (11)
As of 2017-06-28 11:44 GMT
Find Nodes?
    Voting Booth?
    How many monitors do you use while coding?

    Results (632 votes). Check out past polls.