Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Re: Freeze @INC?

by gaal (Parson)
on Jul 24, 2008 at 19:58 UTC ( #699953=note: print w/ replies, xml ) Need Help??


in reply to Freeze @INC?

I read this several times and it's not clear to me if you mean you want to cache the value of @INC, the variable, or snapshot the state on disk.

If it's the former, and you only have data in your computed @INC (not code), you can indeed just serialize to a file and load it in a BEGIN block. You'd probably want your own serialization as Storable might be on the list of things you want to control!

If the latter, I'd suggest avoiding symlink hell and just using PAR.


Comment on Re: Freeze @INC?
Download Code
Re^2: Freeze @INC?
by Surge (Initiate) on Jul 24, 2008 at 21:40 UTC

    I apologize for lack of clarity.

    I do not want to snapshot the disk - the contents will not change.

    As thinking about it makes me realize, I wanted to do two things at once:

    • do the work of computing @INC in advance
    • reduce the number of computed elements in @INC by consolidating contents of multiple locations into one with symlinks

    The first is primarily for manageability and stability, the second is primarily for performance.

    I intend to follow your advice and snapshot a serialized @INC after it is computed. Data::Dumper seems to be the right answer, as it is readily available, if 5.8 or later can be assumed.

    Then I can do a few tests to see whether the performance component is actually a real concern in any of my cases. If so, I can add a sepearate step for consolidating many @INC components into one by caching symlinks.

    Thanks!

      Data::Dumper is available for many versions into the past. I'd be surprised if it wasn't available in 5.0.

      ⠤⠤ ⠙⠊⠕⠞⠁⠇⠑⠧⠊

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others about the Monastery: (8)
As of 2014-08-27 23:02 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The best computer themed movie is:











    Results (253 votes), past polls