in reply to Strange result on array
I started by re-organizing your first statements with spacing
and some print statements:
I am very confused about where @input comes from?use strict; use warnings; my $footprint_im = 'jpg gif png tiff tif'; $footprint_im .= ' '.uc $footprint_im; $footprint_im =~ s/ /\$\|/g; print "footprint_im = $footprint_im\n\n"; # footprint_im = jpg$|gif$|png$|tiff$|tif$|JPG$|GIF$|PNG$|TIFF$|TIF my $footprint_iv = '^vid.+ 3gp mp4 avi'; $footprint_iv .= ' '.uc $footprint_iv; $footprint_iv =~ s/ /\$\|/g; print "footprint_iv = $footprint_iv\n\n"; # footprint_iv = ^vid.+$|3gp$|mp4$|avi$|^VID.+$|3GP$|MP4$|AVI my $footprint_lnk = 'lnk'; $footprint_lnk .= ' '.uc $footprint_lnk; $footprint_lnk =~ s/ /\$\|/g; print "footprint_lnk = $footprint_lnk\n\n"; # footprint_lnk = lnk$|LNK
A statement like this: for($i = 1 ; $i <= @ff ;$i++){} means to iterate to the number of elements in the ff array. WHAT?
Perhaps start by explaining what you are trying to do. Then get some code to compile with use warnings; use strict;
Update: Perhaps:
Oh, I am a bit dubious about the "begins with VID" idea.my @image_files = grep{/\.jpg$|\.gif$|\.tiff$|\.tif$/i}readdir $target +_dir; my @video_files = grep{/^VID.+|\.3gp$|\.mp4$|\.avi$/i}readdir $target_ +dir;
|
|---|