http://qs321.pair.com?node_id=105576


in reply to vowel_search

Your code at present will disregard a matching string on the first line. In addition, you read in the entire file at once, sucking up a good deal of memory if the file is quite large. Here's another way of doing it:

#!/usr/bin/perl -w use strict; # Or don't. See if I care. while (<>) { print if (/[Aa]/ && /[Ee]/ && /[Ii]/ && /[Oo]/ && /[Uu]/); }

I only used the character classes there because (I hear) they're faster than /i matches. Could be wrong on that count, though.

His Royal Cheeziness