in reply to File Checking
#!/usr/bin/perl -w use strict; my @words; my %list; unless ($ARGV[1]){ print "Usage is oneword infile outfile\n"; exit; } open (WORDLIST, "$ARGV[0]")||die "Could not open file $!"; open (OUTFILE, ">$ARGV[1]")||die "Could not open file $!"; while (<WORDLIST>){push (@words => $_)} foreach (@words){$list{$_}=$list{$_}} #this works because if the hash +key #exists already it is replaced! foreach (keys %list){print OUTFILE;}
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: File Checking
by eg (Friar) on Jan 29, 2001 at 01:14 UTC | |
by the_slycer (Chaplain) on Jan 29, 2001 at 01:37 UTC | |
|
Re: Re: File Checking
by Chady (Priest) on Jan 29, 2001 at 00:30 UTC |