Chas Owens wrote:
Okay, I will concede that, but there is generally a character that is
safe (usually the character the line was split on).  In this case
    $hash{join ',', @cdr[2,3,6,7]} = $line;
is safe due to the fact that @cdr was created using split /,/, so I
would recommend that over a multidimensional hash.


Safe until the format of the input changes.  If, for example, you tried this on 
a CSV (comma-separated-values) file, it would fail since commas can be escaped. 
 That is why $; is set to the default value of ASCII \034, a non-printable 
control character that is unlikely to appear in text.  But if you have your 
heart set on a composite key:

{
 local( $" ) = $;;
 $hash{"@cdr[2,3,6,7]"} = $line;
}


--
Just my 0.00000002 million dollars worth,
 Shawn

"For the things we have to learn before we can do them, we learn by doing them."
 Aristotle

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


Reply via email to