## testing to see if the 'do' command worked: my $dict = do "a.pl" or die "could not load for reading: $!, $@"; my $test = $VAR{anode}{def}; print "test: $test\n"; #### ########################### use Data::Dumper; $Data::Dumper::Purity = 1; my @alph = ('a'..'z'); my $hw; my $def; my $pos; for ($a=0; $a < 1; $a++) ## only doing one letter ## until we get dumper ## to work properly #for ($a=0; $a < @alph; $a++) { $cidefile = "cide.".$alph[$a]; ## the file we're reading from $newfilename = $alph[$a] . ".pl"; open(C,$cidefile) || die "\ncould not open $cidefile for reading\n"; open (N,">$newfilename") || die "could not open $newfilename\n"; @file = ; close(C); for ($i=0; $i < @file; $i++) { if ($file[$i] =~ /(.+?)<\/hw>/) { $hw = lc($1); $hw =~ s/\*|\"|\'|\`//gi; if ($file[$i] =~ /(.+?)<\/def>/) { $def = $1; $def =~ s/<.*?>//g; } if ($file[$i] =~ /(.+?)<\/pos>/) { { $pos = $1; } ## save the part of speech and the definition $dict{$hw}{pos} = $pos; $dict{$hw}{def} = $def; } } print N Data::Dumper->Dump([%dict],['dict']); close(N); }