Re: extract words from an array

2006-03-05 Thread Paul Johnson
On Sun, Mar 05, 2006 at 07:24:05AM -0800, Scott Ulmen wrote: > There must be a better (read shorter) way to do what I did. In the > "teach yourself perl" book (I'm trying to learn) there is an activity > as follows: > > Write a short program that does the following: > -Opens a file > -Reads

Re: extract words from an array

2006-03-05 Thread Ryan Gies
Scott Ulmen wrote: There must be a better (read shorter) way to do what I did. foreach $singleline (@lines) { my @stuff = $singleline =~ /\b\w*[^aeiou\s]{4}\w*\b/ig; @stuff and print "matched: ", join( ',', @stuff ), "\n"; } The regular expression: /\b\w*[^aeiou\s]{4}\w*\b/ig 1.