Apache::Description - Managing of descriptions in .htaccess
use Apache::Description; my $d = Apache::Description->new(".htaccess"); while ( my ($file, $desc) = $d->next ) { ## is it the last element ? last unless $file; print "$file : $desc"; }
use Apache::Description; my $d = Apache::Description->new(".htaccess"); print while $d->next;
use Apache::Description; my $d = Apache::Description->new(".htaccess"); if ( $d->ispresent("foo.txt") ) { print "found\n" } else { print "not found\n" }
use Apache::Description; my $d = Apache::Description->new(".htaccess"); $d->add("foo.txt", "bar bar");
use Apache::Description; my $d = Apache::Description->new(".htaccess"); $d->remove("foo.txt");
use Apache::Description; my $d = Apache::Description->new(".htaccess"); my $href = $d->get("foo.txt");
use Apache::Description; my $d = Apache::Description->new(".htaccess"); my $href = $d->getall; ## you can access to the description of foo.txt now : print qq/foo.txt : $href->{"foo.txt"}\n/;
Manage descriptions available in .htaccess with directives like this : AddDescription "my description" "my_filename.txt"
This module give you access to the AddDescription directives in an object oriented way. Thus, you can add, remove or read descriptions.
If an argument is given to the constructor, it will represent the filename of the .htaccess and the method parse will be called.
This function accepts an argument
Returns a couple filename/description.
This method can return an array, or a scalar according to the context of the caller.
@array = ($filename, $description)
$scal = qq/$filename:$description/
Returns the previous description in the same format thant next() method.
Add to the .htaccess a directive AddDescription
Remove a directive from the .htaccess
Returns a reference to a hash of all descriptions where the keys are the filenames.
This method returns the description of the file given in argument.
Returns 1 if $file have a description, 0 otherwise.
None by default.
http://www.madchat.org/ - Website with more than 2000 AddDescription directives.
http://httpd.apache.org/
Nicolas Bareil, <nbareil+cpan@mouarf.org>
Copyright 2003 by Nicolas Bareil
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
To install Apache::Description, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Apache::Description
CPAN shell
perl -MCPAN -e shell install Apache::Description
For more information on module installation, please visit the detailed CPAN module installation guide.