in reply to Re: (tye)Re: Overriding Exporter::import
in thread Overriding Exporter::import

Well, it isn't very new. It wasn't there in 5.001 but then "require VERSION" and "require Module VERSION" weren't either. There all were in 5.004. Unfortunately I don't have any versions between to check. But perl*delta.pod seems to imply that "use VERSION" and "use Module VERSION" were added at 5.004 and "require VERSION" before that.

The docs could be updated to say BEGIN { require Module VERSION; import Module LIST; } rather than what you propose. (: Use perlbug to submit patches to documentation.

        - tye (but my friends call me "Tye")

Replies are listed 'Best First'.
Re: (tye)Re: Overriding Exporter::import
by John M. Dlugosz (Monsignor) on Jul 20, 2001 at 00:22 UTC
    re :BEGIN { require Module VERSION; import Module LIST; }

    True, but less enlightening! It's telling you that import is being called, it ought to tell you that VERSION is being called, too.

    re "it was there...when?"

    According to perldelta, the v-string definitly wasn't in 5.005, and it's less clear whether it was changed between 5.6.0 and 5.6.1.

    If v-strings were not available, and the require Module version (list) requires a v-string literal, than it can't predate 5.6.x either, at least not in a way that's compatible with the current form.

    —John

      &Module::VERSION is documented under require and I'm not much into duplicating documentation. A simple remention of it probably wouldn't hurt, though.

      Update: Er. Rather, &Module::VERSION should be documented under require instead of under use (as it was in 5.6.0 -- I haven't upgraded to 5.6.1 yet) and the use documentation should point to the require documentation, at least, IMHO ("H" stands for "hubristic", don't ya know?).

      Correct, v-strings were added at 5.6.0. I think the biggest changes to them between 5.6.0 and 5.6.1 was that someone settled on a name for them. (: There were some bug fixes having to do with Unicodish stuff that doesn't much matter in this context.

      No, the "require Module VERSION LIST" does not require a v-string literal. With 5.6.0 it, of course, had to support v-string literals. But it does now and always will (I bet) support simple numeric literals. (I encourage you to reread some of this and the related thread.)

              - tye (but my friends call me "Tye")
        grrrr... I was bit by the PM bug of preview going to "search results" instead of the preview, and lost my whole message!!! It's been a problem all day more than normal, but hadn't lost the message before (back button worked). I wish that would be fixed.

        To recap, it never occured to me that the version was a floating-point value, not a string. The syntax does take it (I had tried other things, but not a numeric literal). I'll update my tutorial later. Any other comments on my explorations?

        —John