From owner-freebsd-questions@FreeBSD.ORG Sat Feb 4 17:31:37 2006 Return-Path: X-Original-To: questions@freebsd.org Delivered-To: freebsd-questions@FreeBSD.ORG Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id E183D16A420 for ; Sat, 4 Feb 2006 17:31:37 +0000 (GMT) (envelope-from vaaf@broadpark.no) Received: from osl1smout1.broadpark.no (osl1smout1.broadpark.no [80.202.4.58]) by mx1.FreeBSD.org (Postfix) with ESMTP id 7AAA743D46 for ; Sat, 4 Feb 2006 17:31:37 +0000 (GMT) (envelope-from vaaf@broadpark.no) Received: from osl1sminn1.broadpark.no ([80.202.4.59]) by osl1smout1.broadpark.no (Sun Java System Messaging Server 6.1 HotFix 0.05 (built Oct 21 2004)) with ESMTP id <0IU600BRDBLYFBD0@osl1smout1.broadpark.no> for questions@freebsd.org; Sat, 04 Feb 2006 18:37:10 +0100 (CET) Received: from urban.broadpark.no ([213.187.181.70]) by osl1sminn1.broadpark.no (Sun Java System Messaging Server 6.1 HotFix 0.05 (built Oct 21 2004)) with ESMTP id <0IU6002X0BGR7670@osl1sminn1.broadpark.no> for questions@freebsd.org; Sat, 04 Feb 2006 18:34:04 +0100 (CET) Date: Sat, 04 Feb 2006 18:31:45 +0100 From: Kristian Vaaf In-reply-to: <43E4D2B6.50509@yahoo.co.uk> To: adamnealis@yahoo.co.uk Message-id: <7.0.1.0.2.20060204183041.02101d28@broadpark.no> MIME-version: 1.0 X-Mailer: QUALCOMM Windows Eudora Version 7.0.1.0 Content-type: text/plain; charset=us-ascii; format=flowed Content-transfer-encoding: 7BIT References: <7.0.1.0.2.20060203110425.01744328@broadpark.no> <43E4D2B6.50509@yahoo.co.uk> Cc: questions@freebsd.org Subject: Re: Script to generate names X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 04 Feb 2006 17:31:38 -0000 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++] = ) ) { } > >$i=0; >while ( chomp ( $dictw[$i++] = ) ) { } > >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