) {
chop;
$imagelastmod=0;
($thumbnailname,$thumbnailheight,$thumbnailwidth,
$imagename,$imagesize,$imagewidth,$imageheight,$imagelastmod)=
m#^\s*.*]*>\S{0,4} \s*(.+) \s*(\d+)\sbytes \s*(\d+)\sx\s(\d+) \s* | #o;
next if (! $imagelastmod);
# push(@thumbnailslist,$thumbnailname);
# push(@imageslist,$imagename);
$thumbnails{"$thumbnailname height"} = $thumbnailheight;
$thumbnails{"$thumbnailname width"} = $thumbnailwidth;
$thumbnails{"$thumbnailname imagename"}= $imagename;
$images{"$imagename lastmod"} = $imagelastmod;
$images{"$imagename height"} = $imageheight;
$images{"$imagename width"} = $imagewidth;
$images{"$imagename size"} = $imagesize;
$images{"$imagename thumbnail"} = $thumbnailname;
}
close (CATALOG);
}
# I *DON'T* use the standard Perl lib for parsing command lines
# because I've had trouble with core dumping Perl using those routines
# before. This is simple and reliable. And it doesn't *EVER* core dump.
sub ReadCommandLine {
# parse list has the form 'a:b:c:'
# flags with parse list entries must take values
my($parselist)=$_[0];
my(@CommandLine)=@ARGV;
my(@ParseList,%ParseRules,@GenericList,$item,$parm,$value);
(@ParseList)=split(/:/,$parselist);
foreach $item (@ParseList) {
$ParseRules{$item}=1;
}
while ($parm=shift(@CommandLine)) {
if ($parm =~ m#^\-([a-zA-Z]+)$#o) {
$parm=$1;
$opt{$parm}=1;
if ($ParseRules{$parm}) {
$value=shift(@CommandLine);
if ($value eq "") {
die ("Invalid comand line switch usage, '-$parm' requires value\n");
}
$opt{$parm}=$value;
}
next;
}
push(@GenericList,$parm);
}
@ARGV=@GenericList;
}