John M. Dlugosz has asked for the wisdom of the Perl Monks concerning the following question:
I'd like to override this so that a version number specified on the import args will enable backward compatibility. In the general case, this means (1) setting another package variable to the requested version, so various functions can check that at their lesure; and (2) change what's imported by default (same effect as a different @EXPORTS list).
What's the best/easist/proper way to do that?
(Meanwhile, as for point 1, that should actully be a hash noting which packages asked for which versions, but that's a fine detail.)
If no version number is given in the import list, it should also enable the backward-compatibily mode. So, it needs to check for that first, before calling the super import.
Idea at this point is to scan for version number in the arglist, delete it if found, do a local @EXPORTS to reflect the backversion and then call super's import.
But open to suggestions.
—John
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Overriding Exporter::import
by bikeNomad (Priest) on Jul 19, 2001 at 07:47 UTC | |
by tye (Sage) on Jul 19, 2001 at 09:00 UTC | |
by John M. Dlugosz (Monsignor) on Jul 19, 2001 at 22:26 UTC | |
by tye (Sage) on Jul 19, 2001 at 23:04 UTC | |
by John M. Dlugosz (Monsignor) on Jul 20, 2001 at 00:22 UTC | |
| |
|
Re (tilly) 1: Overriding Exporter::import
by tilly (Archbishop) on Jul 20, 2001 at 01:12 UTC | |
by John M. Dlugosz (Monsignor) on Jul 20, 2001 at 02:40 UTC | |
by tilly (Archbishop) on Jul 20, 2001 at 04:06 UTC |