The constructor may have any name; its assumed to name a path variable as defined above. Returns the object reference.
Returns or sets the platform-specific path separator character, by default : on open platforms and ; on monopolistic ones.
Unless otherwise indicated these methods return the object reference, allowing method calls to be strung together. All methods which take lists join them together using the value of Env::Path->PathSeparator.
Returns the name of the pathvar.
Returns true iff the specified entry is present in the pathvar.
Takes a list and sets the pathvar to that value, separated by the current PathSeparator.
Returns the current path in list format.
For each entry in the supplied list, removes it from the pathvar if present and prepends it, thus ensuring that its present exactly once and at the front.
Analogous to Prepend.
Takes a <dirname> and a list, inserts the list just before the first instance of the <dirname>. If dirname is not found, works just like Prepend. As with Prepend, duplicates of the supplied entries are removed.
Analogous to InsertBefore
Removes the specified entries from the path.
Takes a /pattern/ and a list. Traverses the path and replaces all entries which match the pattern with the concatenated list entries.
Returns a list of all entries which do not exist as filesystem entities.
Removes from the path all entries which do not exist as filesystem entities.
Removes redundant entries (the 2nd through nth instances of each entry).
Takes a pattern and returns an ordered list of all filenames found along the path which match it and are executable.
Returns a string suitable for passing to a shell which would set and export the pathvar to its current value within the shell context.
o No provision is made for path variables which are not also environment variables, a situation which is technically possible but quite rare. o Except where necessary no assumption is made that path entries should be directories, because pathvars like CLASSPATH may contain virtual dirs such as zip/jar files. For instance the DeleteNonexistent method does not remove entries which are files. In Perl terms the test applied is -e, not -d. o The shorthand notation for pathvar FOO is implemented by hacking @FOO::ISA, so theres a slight risk of namespace collision if your code also creates packages with all-upper-case names. No packages are created unless the shorthand notation is employed. o Theres some cute code in the Env module by Gregor N. Purdy for splitting pathvars into arrays using ties. Id love to be able to take advantage of that, and it pains me to do the same thing (and not as well) here rather than using Env. Unfortunately its a newish feature (5.6.0? 5.005? 5.6.1?) in Env and I dont want Env::Path to be tied to the very latest Perls.
UNIX and Windows.
David Boyce <dsbperl AT boyski.com>
Copyright (c) 2000-2001 David Boyce. All rights reserved. This Perl program is free software; you may redistribute and/or modify it under the same terms as Perl itself.
|perl v5.20.3||PATH (3)||2013-05-14|