Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Re: Messing with %INC.

by Anonymous Monk
on Apr 24, 2014 at 13:07 UTC ( [id://1083581]=note: print w/replies, xml ) Need Help??


in reply to Messing with %INC.

How about doing the file? (See also the description and pseudocode in require.)

Replies are listed 'Best First'.
Re^2: Messing with %INC.
by Theodore (Hermit) on Apr 24, 2014 at 13:39 UTC
    Indeed, using do should be lighter and 1 line of code shorter.
    my $code = "require '$fn'"; eval $code;
    can be replaced by:
    do $fn;
    Thanks!

      More than that: do re-evals the file each time it is called, so your manipulation of %INC is not necessary.

        Yes, you are right. That's what i was looking for. So, never mess with %INC still holds as a good advice.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others chilling in the Monastery: (2)
As of 2026-03-08 01:17 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?
    hippoepoptai's answer Re: how do I set a cookie and redirect was blessed by hippo!
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.