Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re: Variable to point to library?

by benizi (Hermit)
on Jul 12, 2004 at 23:15 UTC ( [id://373766]=note: print w/replies, xml ) Need Help??


in reply to Variable to point to library?

The problem is that 'use' statements get wrapped in BEGIN blocks, so $pathtolib isn't set by the time 'use lib' needs it. Here's how you can accomplish what you're looking for:

#!/usr/bin/perl my $pathtolib; BEGIN { $pathtolib = &opentextfile; } # opentextfile must be defined b +efore this line use lib $pathtolib;

or even:

#!/usr/bin/perl # define opentextfile somehow use lib &opentextfile;

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://373766]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others goofing around in the Monastery: (6)
As of 2024-03-28 20:19 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found