in reply to Perlish while loop
how about
use strict; use warnings; my %saw = (); while ( <DATA> ) { next unless ( m#^M.*/([^/]+)# ); my $filename = $1; chomp $filename; $saw{$filename} = 1; } print "People not found\n." unless ( $saw{'people.pdf'} ); print "animal not found\n" unless ( $saw{'animal.pdf'} ); print "MSI file not found\n" unless ( $saw{'setup.msi'} ); __DATA__ M/people.pdf M/wiggles.pdf M/setup.msi
You do twice as many "if"s as necessary: just store everything and do the checks once.
- doug
|
|---|