#!/usr/bin/perl -w $| = 1; # turn off output buffering sub picBlock { my($filename,$align) = @_; return if ! defined($filename); my $rootname = $filename; $rootname =~ s/_small.jpg$/.jpg/; # delete _small for name my $alt = $rootname; $alt =~ s/.jpg$//; # delete .jpg suffix $alt =~ s/_/ /g; # convert underscores to spaces $alt =~ s/\+/ \& /g; # convert + to andphersands with spaces $alt =~ s/([a-z])([A-Z])/$1 $2/g; # insert space into lower-upper transitions print "\n"; print "\n"; print "$alt\n"; } my @files = `ls *small.jpg`; chomp @files; # remove all the trailing newlines my $numRows = 0; print "
\n"; print "
\n"; #my($colorIn1,$colorIn2,$colorBorder1,$colorBorder2) = ( "ffffff","dddddd","334422","110012"); my($colorIn1,$colorIn2,$colorBorder1,$colorBorder2) = ( "ffffff","dde5ed","334422","ffffff"); while (@files) { if ($numRows & 1) { $align = "left"; $color1 = $colorBorder1; $color2 = $colorBorder2; $bkcolor1 = $colorIn1; $bkcolor2 = $colorIn2; } else { $align = "right"; $color1 = $colorBorder2; $color2 = $colorBorder1; $bkcolor1 = $colorIn2; $bkcolor2 = $colorIn1; }; print "
\n"; print "
\n"; print "
\n"; print "\n"; picBlock($files[0],$align); print "\n"; print "
\n"; print "
\n"; if(defined($files[1])) { print "
\n"; print "
\n"; print "
\n"; print "\n"; picBlock($files[1],$align); print "\n"; }; print "
\n"; print "
\n"; print "
\n"; $numRows++; shift @files; shift @files; } print "
\n"; print "
\n";