NAME
Image::Random - select random image from a file
SYNOPSIS
In HTML::Mason, I use this like so:
<img src=<% Image::Random->from_dir('img/frontpage','/img/frontpage') %>>
DESCRIPTION
This module has one function, from_dir
, which selects an image at random from a specified directory. It filters the file list using the regexp
/[.](gif|jpeg|jpg|png)$/
which is stored in the scalar $Image::Random::image_filter
The random number seed is the function Image::Random::srander
.
At present, it does not recursively search directories --- it simply looks in the present directory.
The function requires one argument, which directory to look for image files in. The selected filename is returned sans directory. A second optional argument, if supplied, is prepended to the selected filename. This is very useful in web situations where the Unix path my differ from the webserver path.
EXPORT
None by default.
SEE ALSO
perldoc srand
perldoc perlretut
AUTHOR
Terrence Brannon, <terry@hcoop.net>
COPYRIGHT AND LICENSE
Copyright (C) 2004 by Terrence Brannon
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.8.4 or, at your option, any later version of Perl 5 you may have available.
1 POD Error
The following errors were encountered while parsing the POD:
- Around line 105:
You forgot a '=back' before '=head1'