Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Re: vowel_search

by CheeseLord (Deacon)
on Aug 17, 2001 at 04:09 UTC ( [id://105576]=note: print w/replies, xml ) Need Help??


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

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://105576]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others having an uproarious good time at the Monastery: (4)
As of 2024-04-19 03:46 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found