calypso has asked for the wisdom of the Perl Monks concerning the following question:
#find.pl #!/usr/bin/perl -w use CGI::Carp qw(fatalsToBrowser); use strict; use CGI; use warnings; use Cwd; use File::Find::Rule; my $q = new CGI; my $imageDir = '/var/www/images/'; my $image; my @files; my $files = qr/^\d{6,6}.*\.jpg?$/i; #my $image = $q->param('image'); @files = File::Find::Rule->file ->name($files) ->in($imageDir); print $q->header(); $q->start_html("Images in $imageDir"); foreach my $image (@files){ if( $image){ my $imageFile = $image; $imageFile =~ s/\/var\/www//; print <<HTML; <a href="$imageFile">$imageFile</a><br> <img src="$imageFile"> HTML } else{ print <<HTML; sorry, $imageFile does not exist HTML } } print $q->end_html;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: software error - Can't cd to : HELP !!
by cowboy (Friar) on Feb 04, 2005 at 20:03 UTC | |
by calypso (Initiate) on Feb 04, 2005 at 20:37 UTC | |
|
Re: software error - Can't cd to : HELP !!
by VSarkiss (Monsignor) on Feb 04, 2005 at 22:10 UTC | |
by calypso (Initiate) on Feb 07, 2005 at 17:35 UTC |