[Israel.pm] Re: Another newbie question - Hashes

Murray Gingold tzone at attglobal.net
Thu Feb 5 09:09:49 PST 2004


Sorry for the delay in replying, I get this list in digest form and
therefore it takes a while for me to see messages. 

Yuval Yaari wrote:
>>  %hash = (map {chomp; split / /, $_, 2} <INFILE>);
>The problem with yours would be that usually people prefer 
>to use several spaces to tell between the key and value.
>Just change / / to /\s+/ :)

Well, yes, that's how I usually do code it, but bear in mind that the code
does work anyway with just / / - it would add the extra spaces to the
beginning of the value stored in the hash. Probably not what you want, but
then again maybe it is, depending on the application..

I was wondering, how many others besides me get this list in digest form? 

Murray




More information about the Perl mailing list