App::Framework::Base::SearchPath - Searchable path
use App::Framework::Base::SearchPath ;
Provides a simple searchable path under which to locate files or directories.
When trying the read a file/dir, looks in each location in the path stopping at the first found.
When writing a file/dir, attempts to write into each location in the path until can either (a) write, or (b) runs out of search path
The following fields should be defined either in the call to 'new()', as part of a 'set()' call, or called by their accessor method (which is the same name as the field):
When the write_path is searched, any directories created are created using this mask [default = 0755]
Any paths that contain variables have the variables expanded using the standard environment variables. Specifying this HASH ref causes the variables to be replaced from this HASH before looking in the envrionment.
A comma seperated list (in scalar context), or an ARRAY ref list of paths to be searched (for a file)
A comma seperated list (in scalar context), or an ARRAY ref list of paths to be searched (for a file) when writing. If not set, then path is used.
Create a new SearchPath object.
The %args are specified as they would be in the set method, for example:
'mmap_handler' => $mmap_handler
The full list of possible arguments are :
'fields' => Either ARRAY list of valid field names, or HASH of field names with default values
Initialises the SearchPath object class variables.
Get/set the search path. When setting, can either be:
comma/semicolon seperated list of directories
ARRAY ref to list of directories
When getting in scalar context returns comma seperated list; otherwise returns an ARRAY.
Get/set the write path. Set the path for writing file/dir. If this is not set then uses 'path'. You can set this to something different to ensure that created files are limited to user home directory (for example).
When setting, can either be:
Search through the search path attempting to read $file. Returns the file path to the readable file if found; otherwise returns undef
Search through the search path attempting to write $file. Returns the file path to the writeable file if found; otherwise returns undef
Setting the debug flag to level 1 prints out (to STDOUT) some debug messages, setting it to level 2 prints out more verbose messages.
Steve Price <sdprice at cpan.org>
<sdprice at cpan.org>
None that I know of!
To install App::Framework, copy and paste the appropriate command in to your terminal.
cpanm
cpanm App::Framework
CPAN shell
perl -MCPAN -e shell install App::Framework
For more information on module installation, please visit the detailed CPAN module installation guide.