Script to generate names

Kristian Vaaf vaaf at broadpark.no
Sat Feb 4 09:31:38 PST 2006


At 17:13 04.02.2006, Adam Nealis wrote:

>That's going to ba a large file of mixed words!
>
>Would be faster in perl than in the shell. Put the below in a file, 
>and run it like this:
>
>perl myfile.pl > myListOfMixedWords
>
>#!/usr/bin/perl
>
>use warnings;
>use strict;
>
>my @custw;
>my @dictw;
>my $cw;
>my $dw;
>my $i;
>
>open F1, "web2.head-100";
>open F2, "web2.tail-100";
>
>while ( chomp ( $custw[$i++] = <F1> ) ) { }
>
>$i=0;
>while ( chomp ( $dictw[$i++] = <F2> ) ) { }
>
>foreach $cw ( @custw ) {
>    foreach $dw ( @dictw ) {
>       print "$cw$dw\n";
>       print "$dw$cw\n";
>    }
>}

I'm not sure man, I think Perl is a bit overkill.
Besides if I were to use it, that mean that I'd have to learn it.
And I think I'd rather learn Ruby if I were to do that high level stuff.

Thanks a lot though!

:)

All the best,
Kristian




More information about the freebsd-questions mailing list