Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical

Re^5: Checking for duplicate subroutine names

by pokki (Monk)
on Oct 13, 2012 at 23:56 UTC ( #998888=note: print w/ replies, xml ) Need Help??

in reply to Re^4: Checking for duplicate subroutine names
in thread Checking for duplicate subroutine names

Then you can just declare your subs in packages, as others have already said. To overwrite your own subs, users would need to name them with their fully qualified name, e.g. package Plugin; sub Core::overwritten_routine { return "foo" }. That is rather hard to write by accident.

After that, the only thing I can see to prevent (probably malicious, at this point) users from overwriting your subs is whipping up some PPI and checking any source files you require before actually requiring them. With your setup and in your environment, the hassle is probably not worth it.

Comment on Re^5: Checking for duplicate subroutine names
Select or Download Code

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (6)
As of 2015-11-28 16:15 GMT
Find Nodes?
    Voting Booth?

    What would be the most significant thing to happen if a rope (or wire) tied the Earth and the Moon together?

    Results (743 votes), past polls