in reply to perl module creation problem

Apart from what Evan already said ... drop the BEGIN{...} and require Exporter. Unless you are doing something very very awkward with the @ISA, @EXPORT and @EXPORT_OK in the rest of your code, the BEGIN{...} is unnecessary.

Jenda
Enoch was right!
Enjoy the last years of Rome.

Replies are listed 'Best First'.
Re^2: perl module creation problem
by Anonymous Monk on Nov 13, 2009 at 15:01 UTC

    It seems that @EXPORT = qw( foo ) works in addition to @EXPORT = qw( &foo ) for a function foo in the module. I didn't realize the "&" was required. Why does it still work without the "&"?

      Because most often you want to export subroutines and because most of the time whe you call subroutines you do not use the & either. So it's reasonable to write the module so that it exports the subroutine if you do not specify any sigil.

      Jenda
      Enoch was right!
      Enjoy the last years of Rome.

        Heh. So, it works because that's the way it ought to work :). Ok by me.