Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re^11: Howto "use" backward compability packages of new "feature"s

by ikegami (Patriarch)
on Aug 25, 2010 at 23:08 UTC ( [id://857335]=note: print w/replies, xml ) Need Help??


in reply to Re^10: Howto "use" backward compability packages of new "feature"s
in thread Howto "use" backward compability packages of new "feature"s

pragmas are files???

Where were you planning on storing the code for stricter?

then my point should be clear!

I don't agree that

use Module VERSION LIST use Module VERSION use Module LIST use Module use VERSION BEGIN { require Module; Module->import( LIST ); }
is less clear than
use LibraryFile VERSION LIST use LibraryFile VERSION use LibraryFile LIST use LibraryFile use VERSION BEGIN { require LibaryFile; Module->import( LIST ); }

Especially since use doesn't take a file name.

Replies are listed 'Best First'.
Re^12: Howto "use" backward compability packages of new "feature"s
by LanX (Saint) on Aug 26, 2010 at 13:33 UTC

      You are mistaken. stricter is a lexically scoped compile-time effect from a use statement. It's very much a pragma.

      To avoid naming conflicts with future pragmas it shouldn't even be named "stricter", rather "My::stricter"

      And it should have documentation. Not relevant.

      Anyway I bet some of the pragmas listed will not support the import interface.

      Are you saying there are pragmas that don't use use, or that use doesn't call import as documented?

      Not only that, but it's impossible for a pragma to function without defining an import method. Pragmas must execute code every time its use is encountered, so they must use import. require only executes code the first time it's called for a module. Not using the "import interface" is impossible.)

      Update: Added second-last paragraph.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (7)
As of 2024-03-28 19:18 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found