Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer

Re: Package name overlap

by Dallaylaen (Pilgrim)
on Feb 19, 2013 at 15:23 UTC ( #1019589=note: print w/replies, xml ) Need Help??

in reply to Package name overlap

Perhaps you're still better off renaming the module, here's why.

Perl loads every module only once, see %INC in perlvar. So, if English is used internally by some other module down the road (which is likely, because it's 2012 and punctuation variables smell), it will not be loaded again. Instead, your module's import method will be called.

But use English; exports a lot of stuff into the calling package, like $ERRNO etc. And suddenly a random module not even used directly by the code you control breaks with a syntax error message!

Here's a little demo (run it as far as possible from your real!). Note the "not permitted" part is as planned (not a real error). The "echo 1" comand creates a correct empty module.

-bash$ rm -bash$ perl -Mstrict -I. -wle 'use English; $ERRNO=1; print $ERRNO; ' Operation not permitted -bash$ echo 1 > -bash$ perl -Mstrict -I. -wle 'use English; $ERRNO=1; print $ERRNO; ' Global symbol "$ERRNO" requires explicit package name at -e line 1. Global symbol "$ERRNO" requires explicit package name at -e line 1. Execution of -e aborted due to compilation errors.

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others pondering the Monastery: (7)
As of 2016-10-26 03:17 GMT
Find Nodes?
    Voting Booth?
    How many different varieties (color, size, etc) of socks do you have in your sock drawer?

    Results (331 votes). Check out past polls.