in reply to Re: Re: using package functions and vars withouth packagename::
in thread using package functions and vars withouth packagename::

You can still use strict while satisfying the need for @ISA and @EXPORT to be package globals in one of a couple ways. Here are some contrived examples:

# Example 1... The best pre-Perl v5.6.0 way. package foobar; use strict; use warnings; use vars qw(@ISA @EXPORT); @ISA = qw(Exporter); @EXPORT = qw(foo bar); # Example 2... The best Perl v5.6.0 + way. package foobar; use strict; use warnings; our @ISA = qw(Exporter); our @EXPORT = qw(foo bar); # Example 3... The 'base' way. package foobar; use strict; use warnings; use base qw(Exporter); # But you still have to either 'use vars' or 'our' for the # export list @EXPORT. our @EXPORT = qw(foo bar);


Dave

  • Comment on Re: Re: Re: using package functions and vars withouth packagename::
  • Download Code