Instead of exporting the callbacks unconditionally, why not use EXPORT_OK? Then you would have to explicitly name then in the use declaration, but I believe it may solve your problem of calling package local subroutines from the callbacks.
I.e., instead of this:
package main; use webdav; # ... package webdav; require Exporter; @ISA = qw(Exporter); @EXPORT = qw( get_content ...); # replace this
use this:
# same as above @EXPORT_OK = qw( get_content ...); # with this
And then use this in your using code:
use webdav qw( get_content ...);
Perhaps a better solution is to explicitly prefix your coderefs with the package name they live in.
dmm
If you GIVE a man a fish you feed him for a dayIn reply to Re: Passing coderefs across packages and calling them in the wrong package
by dmmiller2k
in thread Passing coderefs across packages and calling them in the wrong package
by jepri
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |