Env::PathEnv::Path is a Perl module with advanced operations on path variables. | |
Download |
Env::Path Ranking & Summary
Advertisement
- License:
- Perl Artistic License
- Price:
- FREE
- Publisher Name:
- David Boyce
- Publisher web site:
- http://search.cpan.org/~dsb/
Env::Path Tags
Env::Path Description
Env::Path is a Perl module with advanced operations on path variables. Env::Path is a Perl module with advanced operations on path variables.SYNOPSIS use Env::Path; # basic usage my $manpath = Env::Path->MANPATH; $manpath->Append('/opt/samba/man'); for ($manpath->List) { print $_, "n" }; # similar to above using the "implicit object" shorthand Env::Path->MANPATH; MANPATH->Append('/opt/samba/man'); for (MANPATH->List) { print $_, "n" }; # one-shot use Env::Path->PATH->Append('/usr/sbin'); # change instances of /usr/local/bin to an architecture-specific dir Env::Path->PATH->Replace('/usr/local/bin', "/usr/local/$ENV{PLATFORM}/bin"); # more complex use (different names for same semantics) my $libpath; if ($^O =~ /aix/) { $libpath = Env::Path->LIBPATH; } else { $libpath = Env::Path->LD_LIBRARY_PATH; } $libpath->Assign(qw(/usr/lib /usr/openwin/lib)); $libpath->Prepend('/usr/ucblib') unless $libpath->Contains('/usr/ucblib'); $libpath->InsertAfter('/usr/ucblib', '/xx/yy/zz'); $libpath->Uniqify; $libpath->DeleteNonexistent; $libpath->Remove('/usr/local/lib'); print $libpath->Name, ":"; for ($libpath->List) { print " $_" }; print "n"; # simplest usage: bless all existing EV's as Env::Path objects use Env::Path ':all'; my @cats = PATH->Whence('cat*'); print "@catsn"; Requirements: · Perl
Env::Path Related Software