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