in reply to to much hubris

@{[caller(1)]}[0] is better written (caller(1))[0].

And perlsub says:

Subroutines whose names are in all upper case are reserved to the Perl core, as are modules whose names are in all lower case.

Update: I don't see any reason for a supposed light-weight Exporter replacement to support use Foo "bar baz"; as an alternate form of use Foo qw/bar baz/;. It's cute, and easy to code, but not worth introducing an API difference for. What if Foo.pm switches back from your exporter to the standard one, or somebody else's replacement; then users of Foo who took advantage of the 2-character savings are broken.

Update 2: You really ought to check for invalid identifiers. And as a bonus, you could make leading digits trigger a $from->VERSION($_) version check, ala Exporter.

Replies are listed 'Best First'.
Re^2: to much hybries
by pmSwim (Acolyte) on Feb 08, 2007 at 19:27 UTC
    It is not a replacement for Exporter and could not be. If I would publish a normal perl module I would use Exporter. The plan is, to introduce it as an alternative, which has to be well chosen. So a difference in the API is not so problematic. The Version check is a good idea. Thank you for your reply.
    Sorry, for the typo in the headline. This is what I mean:
    i	hubris	 	die Anmaßung
    i	hubris	 	die Hybris
    
    Writing a good and reliable perl module is more work than I thought, but it makes fun.
      Now you've confused me; if it's not a lightweight alternative to Exporter, what is it? Who would you envision using it, and why?
        What it should make, I described here.