Hi Shawn, Thank you very much,
Shown from your code below and my print1 and prin2 comments below: print1 correctly prints the following: emcpoweraa sdae sdch sdek sdgn /dwpdb033 emcpowerd sdba sddd sdfg sdhj /odsdb005 emcpowerc sdbb sdde sdfh sdhk /odsdb006 emcpowerbc sdb sdbe sddh sdfk /s00_11 emcpowerbc sdb sdbe sddh sdfk /utl_file_dir emcpowera sdbd sddg sdfj sdhm /dwpdb006 print2 incorrectly prints the following: emcpoweraa sdae sdch sdek sdgn emcpowerd sdba sddd sdfg sdhj emcpowerc sdbb sdde sdfh sdhk emcpowerbc sdb sdbe sddh sdfk emcpowera sdbd sddg sdfj sdhm Print2 should only print this line: emcpowerz" => "sdba sddd sdfg sdhj my( %hash3, %nothash ); my $found = 0; while( my( $ikey, $ival ) = each( %hash1 ) ) { while( my( $jkey, $jval ) = each( %hash2 ) ) { (my $mkey = $jkey ) =~ s/[0-9]//g; if( $ikey eq $mkey ) { $hash3{ $ikey } = $ival . " " . $jval; $found = 1; print "$ikey $ival $jval\n"; # <-------------------- print1 } } if( $found == 1 ) { $nothash{ $ikey } = $ival; $found = 0; print "$ikey $ival\n"; # <------------------------------ print2 } } Many thanks for your help! Wernher -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/