Hello
I'm having tough time trying to solve a problem at some regex. I have
several pictures for cars, and want to use a script to create some HTML
files using those pictures.
For each car, I have three pictures named e.g. jeep.1.jpg, jeep.2.jpg
and jeep.3.jpg.
What am trying to do now, is to use a regex to select the three picture
of each car brand, and assign to an array e.g. @pictures. Further down
in my script, I'll assign each item my @pictures to a scalar - like
jeep.1.jpg to $picture1 and so on. The pattern matching that I wrote is
working.
Below is an uncompleted subroutine for that purpose:
sub product_img {
my ($image, @bigger, @smaller);
if (-d "images"){
opendir (IMAGESDIR, "images") || images_error;
while(defined($image = readdir(IMAGESDIR))){
if (-f $image && $images =~ /(*\.gif | *\.jpe?g)/)$i){
if ($image =~ /[A-Za-z]\.[A-Za-z]/i)){
push (@bigger, $image);
}else {
push ($smaller,$image);
}
foreach (@bigger){
my @rest_img = grep //
}
} else { die "There isn't any pictures in the specified
folder!"}
}
}else {
}
==========================================================
I only need help to get my pattern matching to work.
Thanks Guys