develooper Front page | perl.beginners | Postings from February 2002

Re: help with scalar references

Thread Previous
From:
Jeff 'japhy' Pinyan
Date:
February 7, 2002 10:57
Subject:
Re: help with scalar references
Message ID:
Pine.GSO.4.21.0202071356520.15873-100000@crusoe.crusoe.net
On Jan 16, Karthik Gurumurthy said:

>($a,$b,$c) = (\"1",\"2",\"3");
>
>%hash = ($a=>"hello",$b=>"Perl");

You cannot use references as the keys to a hash, because hash keys must be
strings.

If you're REALLY desperate, you can use Tie::RefHash, but I don't think
you should be so desperate.

-- 
Jeff "japhy" Pinyan      japhy@pobox.com      http://www.pobox.com/~japhy/
RPI Acacia brother #734   http://www.perlmonks.org/   http://www.cpan.org/
** Look for "Regular Expressions in Perl" published by Manning, in 2002 **
<stu> what does y/// stand for?  <tenderpuss> why, yansliterate of course.


Thread Previous


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About