Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re: use, require, do or what?

by almut (Canon)
on Jul 30, 2008 at 19:56 UTC ( [id://701253]=note: print w/replies, xml ) Need Help??


in reply to use, require, do or what?

I'm not recommending this approach, but if you really need to get it working, you can eval Library.pl's content. That's similar to do, but differs in that lexical variables in the enclosing scope are visible in the eval.

my $variable1; open my $lib, "<", "./Library.pl" or die $!; { local $/; eval <$lib>; } close $lib; print "$variable1\n";

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others scrutinizing the Monastery: (3)
As of 2024-04-25 16:25 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found