RE: reference to a subroutine in @INC

2003-11-11 Thread Raj (Basavaraj) Karadakal
: reference to a subroutine in @INC On Tue, Nov 11, 2003 at 04:12:03PM -0500, Raj (Basavaraj) Karadakal wrote: > Hi, > I am trying to package a perl script and the modules it uses , in a > tar file. When untarred on any machine, the modules can be found in a known Have you looked at PAR? &

Re: reference to a subroutine in @INC

2003-11-11 Thread Paul Johnson
On Tue, Nov 11, 2003 at 05:04:43PM -0500, Bob Showalter wrote: > Bob Showalter wrote: > > You can't use a reference to a subroutine in @INC > > Oops. Apparently in 5.8, you *can* do this. And earlier, though it wasn't documented. I think this message started the ball

Re: reference to a subroutine in @INC

2003-11-11 Thread Steve Grazzini
On Tue, Nov 11, 2003 at 05:02:28PM -0500, Bob Showalter wrote: > > What am I doing wrong? > > You can't use a reference to a subroutine in @INC; you need to use paths. It's a new feature (although the OP should probably be using FindBin like you said). % perldoc -f requ

RE: reference to a subroutine in @INC

2003-11-11 Thread Bob Showalter
Bob Showalter wrote: > You can't use a reference to a subroutine in @INC Oops. Apparently in 5.8, you *can* do this. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

RE: reference to a subroutine in @INC

2003-11-11 Thread Bob Showalter
open (MOD,"$modPath") or die "Cannot open $modPath $!\n"; > return MOD ; }else { > return undef ; > } > } > > BEGIN { push ( @INC, \&readMod ); } > use setuprhost; > &setuprhost::Setup(); > > > What am I doing wrong? You

Re: reference to a subroutine in @INC

2003-11-11 Thread Steve Grazzini
use FindBin qw($Bin); # warts and all use lib "$Bin/lib"; use YourModule; > But for this to work the user should always be in the same directory as the > script. To overcome this limitation of my script, I am trying to use a > reference to a subroutine in @INC, which return

Re: reference to a subroutine in @INC

2003-11-11 Thread Paul Johnson
script. To overcome this limitation of my script, I am trying to use a > reference to a subroutine in @INC, which returns the filehandle to the > module. When I run my script, I am able to find the module and open it, and > return the filehandle, but the perl still complains that it cannot f

Re: reference to a subroutine in @INC

2003-11-11 Thread drieux
reference to a subroutine in @INC, which returns the filehandle to the module. When I run my script, I am able to find the module and open it, and return the filehandle, but the perl still complains that it cannot find the module. there are three basic ideas you might want to consider a. have your

reference to a subroutine in @INC

2003-11-11 Thread Raj (Basavaraj) Karadakal
. So only way the script can find modules is by using relative path in @INC. But for this to work the user should always be in the same directory as the script. To overcome this limitation of my script, I am trying to use a reference to a subroutine in @INC, which returns the filehandle to the