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

That's a relativly new feature, isn't it? I don't recall ever seeing the "indirect object" for use before.

The perldoc you mentioned seems to be reciently updated, since it's not entirely consistant. It still says it's exactly the same as BEGIN { require Module; import Module LIST; } but doesn't mention VERSION. It should say BEGIN { require Module; Module::VERSION (VERSION); import Module LIST; } which is confusing because VERSION is used both as a actual token and as a placeholder, so whoever edits that should make other changes too.

Who maintains the perldocs? I'd like to submit a correction or at least inform the proper person.

—John

Replies are listed 'Best First'.
(tye)Re2: Overriding Exporter::import
by tye (Sage) on Jul 19, 2001 at 23:04 UTC

    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")
      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")