Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Re^2: Best practices for local libraries

by haukex (Archbishop)
on Dec 07, 2019 at 10:28 UTC ( [id://11109797]=note: print w/replies, xml ) Need Help??


in reply to Re: Best practices for local libraries
in thread Best practices for local libraries

So, I might prepend a BEGIN block and push the local path to @INC. I just looked it up, here's what I did in a script some time before: ...

I'd suggest using the lib pragma (which unshifts instead of pushing) in combination with FindBin instead; $0 can in some cases be unreliable, and the code is shorter. So if there are .pm files in the same path as the script: use FindBin; use lib $FindBin::Bin;.

Finally, into some scripts I copied every module needed, also cpan modules, getting a huge single script.

See fatpack and pp, although with some modules they have issues.

Replies are listed 'Best First'.
Re^3: Best practices for local libraries
by misc (Friar) on Dec 07, 2019 at 11:04 UTC
    Thanks a lot, that's good news.
    You remember me why I married perl a long time ago ;)

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others imbibing at the Monastery: (5)
As of 2024-03-29 07:49 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found