Edward WIJAYA wrote:

Mine is not as elegant as J.Krahn's or Jeff's. But it's an alternative. I am just glad to contribute at least something to the forum I have owed so much...

-----------------------
use strict;
use warnings;
use Data::Dumper;

my %hash = ();

while (<DATA>) {
        s/\s//g;

You may be removing too many whitespace characters if any of the fields has embedded whitespace.


        /(\w+)=(\w+)/;
        $hash{$1} = $2;

You should only use the digit variables ($1, $2, etc.) if the match was successful or their contents will be left over from the last successful match.


}


John
--
use Perl;
program
fulfillment

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>




Reply via email to