5 print "Usage: $0 <filename> \n";
10 print "File: $filename\n";
11 open(FILE
, $filename) or die("Could not open file $filename");
15 foreach $line (@alllines)
17 if ($line =~ m/<title>(\w+)<\/title
>/) {
22 } elsif ($collect eq 'ETYMOLOGY') {
23 print "Etymology: $line \n";
25 } elsif ($line =~ m/===Etymology/) {
26 $collect = 'ETYMOLOGY';
28 } elsif ($collect eq 'NOUN') {
29 if ($line =~ m/^#:/) {
30 print "Noun Usage: $line";
31 } elsif ($line =~ m/^#/) {
32 print "Noun Meaning: $line";
33 } elsif ($line =~ m/^==/) {
36 } elsif ($line =~ m/==Noun/) {
39 } elsif ($collect eq 'VERB') {
40 if ($line =~ m/^#:/) {
41 print "Verb Usage: $line";
42 } elsif ($line =~ m/^#/) {
43 print "Verb Meaning: $line";
44 } elsif ($line =~ m/^==/) {
47 } elsif ($line =~ m/==Verb/) {
50 } elsif ($collect eq 'ADJECTIVE') {
51 if ($line =~ m/^#:/) {
52 print "Adjective Usage: $line";
53 } elsif ($line =~ m/^#/) {
54 print "Adjective Meaning: $line";
55 } elsif ($line =~ m/^==/) {
58 } elsif ($line =~ m/==Adjective/) {
59 $collect = 'ADJECTIVE';