my $directory = ('../htdocs/archive/'); my $prefix = 'Arch'; my $suffix = 'php'; opendir DIR, $directory or die $!; while (my $entry = readdir DIR) { next if $entry !~ m/^$prefix/; # Prefix doesn't match => next filename next if $entry !~ m/$suffix$/; # Sufffix doesn't match => next filename print $entry,"\n
"; } closedir DIR; open my $entry_file, '<', $entry or die $!; print "

"; print <$entry_file>; print "

"; close $entry_file;