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

Where what is documented, the run-time equivalent of use? In use.

just found an "if pragma" which could be used for backwards compatibility!

You found it at the top of the post to which you replied.

Replies are listed 'Best First'.
Re^6: Howto "use" backward compability packages of new "feature"s
by LanX (Saint) on Aug 24, 2010 at 02:04 UTC
    > Where what is documented, the run-time equivalent of use? In use.

    Well it's documented for "MODULE"s, but is it evident that it's possible to call an "import" method on a pragma?

    There is no builtin "import" function.

    Hmm at least it's consistent, which is brilliant! :)

    >You found it at the top of the post to which you replied.

    nonsense, I oversaw it there! ;)

    Cheers Rolf

      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;.

        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