Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

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

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


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

Well it's documented for "MODULE"s

Yes, and if you look right above, all the usage modes of use are use Module ...; except for use VERISON;.

Replies are listed 'Best First'.
Re^8: Howto "use" backward compability packages of new "feature"s
by LanX (Saint) on Aug 25, 2010 at 09:38 UTC
    and if you look further down pragmas are called "pseudo-modules".

    I will open a ticket to add the "use stricter" example to the perldoc.

    UPDATE:

    pragmas are not even mentioned in require, it only talks about "library files" and do/eval file mechanisms.

    Otherwise, require demands that a library file be included if it hasn't already been included. The file is included via the do-FILE mechanism, which is essentially just a variety of eval with the caveat that lexical variables in the invoking script will be invisible to the included code. Has semantics similar to the following subroutine: ...

    Cheers Rolf

      You are saying there's some undocumented usage for pragmas. That's not true. use strict; matches the use Module; pattern, which is documented to be the same as BEGIN { require strict; strict->import(); }.

      Anyway, pragmas refers to modules that behave in a certain fashion. There's nothing special about them as far as Perl is concerned.

      pragmas are not even mentioned in require, it only talks about "library files"

      First you complain that "Modul"e is too specific, now you complained that the more generic term doesn't apply.

        pragmas are files???

        and if library files are the "more generic term", then my point should be clear!

        thank you! :)

        Cheers Rolf

      pragmas are not even mentioned in require
      Note that pragmas don't exist on the language level. That is, Perl (the language) doesn't treat modules whose name is all lowercase different from modules who do not. "Pragmas" (or as some people call them "pragmata") are a loosly defined concept; typically as 'modules that influence the compilation process in some way'. But any module that exports prototyped subroutines influences compilation. And so do source filters. Many people consider "constant.pm" to be a pragma, but all it does is export subs with an empty prototype. But Fcntl and POSIX do so as well.

      Perhaps one could consider modules that set parts of @H and %H to be pragmas.

        they are called "compiler directives" in use which I think is quite OK.

        I just wanna know if I can "require+import" any pragma like I can do with "real" moduls.

        If yes I would like to consider to clarify this behavior in the documentation.

        Thats why I asked you to test if it works like this in your older perl installations.

        (something tells me that it wasn't always like it is now.)

        And if it can't be clearly documented because it's not a reliable feature only restricted to special pragmatas, I would like to know it.

        Cheers Rolf

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others lurking in the Monastery: (3)
As of 2024-04-24 20:53 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found