[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

Re: [FWP] name-a-band




Rick wrote:
> 
> Andy Lester wrote:
> >
> > I wrote up a little band name generator that sucks up /usr/dict/words and
> > cranks out band names.  They turn out to be eerily feasible.
... 
> I must need help, 'cause I shortened it to:
> 
> #!/usr/bin/perl -w
> 
> use strict;
> 
> chomp(my @dict = `cat /usr/dict/words`);
> printf $_, map ucfirst $dict[rand @dict], 1..3 while <DATA>;
> __END__
> The %s %s
> The %s %s of %s
> %s %s and the %s
> %s and the %s %s
> %s %s
> %s

I changed yours a little.  Run on perlfunc.pod.

my @dict;
while (<>) {
    push @dict, /C<(\w+)>/g;
}
printf <<'END', map ucfirst $dict[rand @dict], 1..14;
The %s %s
The %s %s of %s
%s %s and the %s
%s and the %s %s
%s %s
%s
END

Here are some Perlish names I get:

The Undef Package
The Hex Umask of 123
Undef Pop and the Kill
Grep and the Goto Ref
Bless Setpriority
0666

Are there bands at the Perl Conference?  What a great way for them to
pick their name.

Tres fun, Andy.  :-)

-- 
Rick Delaney
rick.delaney@home.com

==== Want to unsubscribe from Fun With Perl?  Well, if you insist...
==== Send email to <fwp-request@technofile.org> with message _body_
====   unsubscribe