Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Re: Adding directories to the end of @INC

by Khen1950fx (Canon)
on Jul 01, 2011 at 17:35 UTC ( [id://912388]=note: print w/replies, xml ) Need Help??


in reply to Adding directories to the end of @INC

But it's a bit cryptic...

Let's make it a little less cryptic.

#!/usr/bin/perl use strict; use warnings; use Data::Dumper::Concise; my $foo; my $bar; BEGIN { $foo = '/foo'; $bar = '/bar'; } my(@dirs) = ($foo, $bar); use lib @dirs; push @INC, @dirs; print Dumper(@dirs), "\n", join("", @INC), "\n"; no lib @dirs; exit;
Update: Used lib::tiny and made a few changes.
#!/usr/bin/perl use strict; use warnings; use Data::Dumper::Concise; my $foo; my $bar; BEGIN { $foo = '/foo'; $bar = '/bar'; } my @dirs = ($foo, $bar); use lib::tiny @dirs; push @INC, @dirs; foreach my $dir(@dirs) { print Dumper(join("", @INC)), Dumper($dir), "\n"; } no lib::tiny @dirs; exit;

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others about the Monastery: (2)
As of 2026-04-14 05:05 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.