#!/usr/athena/bin/perl use strict; ($#ARGV == 0) or die "Wrong number of arguments: $!"; open (LPOUT, '<', $ARGV[0]) or die "Couldn't open $ARGV[0]: $!"; $_ = ; open (NWORDS, '>', $ARGV[0] . "_nwords") or die "Couldn't open $ARGV[0]_nwords: $!"; print NWORDS $_; close (NWORDS) or die "Couldn't close $ARGV[0]_nwords: $!"; $_ = ; open (NUNIQUE, '>', $ARGV[0] . "_nunique") or die "Couldn't open $ARGV[0]_nunique: $!"; print NUNIQUE $_; close (NUNIQUE) or die "Couldn't close $ARGV[0]_nunique: $!"; $_ = ; $_ = ; open (WORDS, '>', $ARGV[0] . "_words") or die "Couldn't open $ARGV[0]_words: $!"; open (WORDFREQS, '>', $ARGV[0] . "_wordfreqs") or die "Couldn't open $ARGV[0]_wordfreqs: $!"; while ($_ =~ /\S+/) { chomp; my @d = split (/ /, $_); print WORDS $d[1] . "\n"; print WORDFREQS $d[2] . "\n"; $_ = ; } close (WORDS) or die "Couldn't close $ARGV[0]_words: $!"; close (WORDFREQS) or die "Couldn't close $ARGV[0]_wordfreqs: $!"; $_ = ; open (LFREQS, '>', $ARGV[0] . "_lfreqs") or die "Couldn't open $ARGV[0]_lfreqs: $!"; while ($_ =~ /\S+/) { print LFREQS $_; $_ = ; } close (LFREQS) or die "Couldn't close $ARGV[0]_lfreqs: $!"; $_ = ; open (RFREQS, '>', $ARGV[0] . "_rfreqs") or die "Couldn't open $ARGV[0]_rfreqs: $!"; while ($_ =~ /\S+/) { print RFREQS $_; $_ = ; } close (RFREQS) or die "Couldn't close $ARGV[0]_rfreqs: $!"; close (LPOUT) or die "Couldn't close $ARGV[0]: $!";