If I understand your name construction properly you expected NNNN.NNNN.jpg/^(\d+).*/
I would write the code slightly more carefully (your 1st foreach loop) note the \.
Code suggestion, you might want to replace my $k = 0 + keys %uniquelist; with my $k = scalar keys %uniquelist;, as some may feel this is more explicit.my %uniquelist; my %deletelist; my $h = 0; foreach my $pic (@filelist) { next unless ($pic =~ /\.jpg$/); if( $pic =~ /^(\d+)\.(\d+)/) { my ($num,$counter) = ( $1,$2); $h++; $uniquelist{$num}++; next if ($currentlist{$num}); $deletelist{$pic}++; } else { print STDERR "saw a photo file ($pic) that did not match the expect +ed naming pattern!\n"; } }
In reply to Re: Build a list of files that are NOT in a list
by stajich
in thread Build a list of files that are NOT in a list
by amelinda
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |