CGI::PathRequestGet file info in a cgi environment | |
Download |
CGI::PathRequest Ranking & Summary
Advertisement
- License:
- Perl Artistic License
- Price:
- FREE
- Publisher Name:
- Leo Charre
- Publisher web site:
- http://search.cpan.org/~leocharre/
CGI::PathRequest Tags
CGI::PathRequest Description
Get file info in a cgi environment CGI::PathRequest is a Perl module to get file info in a CGI environment.SYNOPSIS use CGI::PathRequest; my $r = new CGI::PathRequest; if( $r->set('/home/me/public_html/documents') ){ $r->is_in_DOCUMENT_ROOT or warn 'not in document root, sure you wanna serve?'; if ( $f->is_dir ){ print $f->filename . " is a directory in " . $f->rel_loc ." it contains ". $f->ls_count. " entries." ; }; Conventions used in this document:resource = the main file requested, be it a directory, file, etc.This is kind of my swiss army knife of dealing with files in a cgi environment. It's mainly geared for taking requests from a client and setting default information about that resource. The constructor is told the relative path to a file (or directory) and from that you can ask a lot of really useful things like, relative path, absoltue path, filename, filesize, absolute location, relative location, etc. Things you normally have to regex for, they are already done here.CGI::PathRequest inherits File::PathInfo and all its methods. Requirements: · Perl
CGI::PathRequest Related Software