Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re: character classes

by chromatic (Archbishop)
on Aug 21, 2000 at 05:19 UTC ( [id://28756] : note . print w/replies, xml ) Need Help??


in reply to charachter classes, and a misunderstanding...

Here's another approach that's not necessarily better, but has a certain charm anyway:
#!/usr/bin/perl -w use strict; @ARGV = qw(/usr/dict/words); my $longest = ''; while (<>) { chomp; next unless length > length $longest; if (length == tr/qwertasdfgzxcvb/qwertasdfgzxcvb/) { $longest = $_; } } print $longest;

Replies are listed 'Best First'.
RE: Re: character classes
by merlyn (Sage) on Aug 21, 2000 at 07:03 UTC