On Tue, Sep 04, 2001 at 07:20:27PM +0200, Quincy Ntuli wrote:
>
> greetings
>
> I am trying to return the value from an associate array; i do not understand what i
>am doing wrong.
>
...code that others already commented on snipped...
> $theHash{'$sortedListing[1]'} =[$dbRec];
You have a quoting problem. You stuff *everything* you read into
theHash at the key '$sortedListing[1]'. The single quotes make sure the
content of the string inbetween isn't evaluated. To get the value of
the variable $sortedListing[1] as the key to your hash, use double
quotes (").
And always remember: Data::Dumper is your friend:
...
use Data::Dumper;
...
print Dumper(\%theHash);
will give you a nice pretty-printed dump of your hash which will show
you the problem.
> print "\$sortedListing[1] is ($theHash{'$sortedListing[1]'})\n";
Note, that the single quotes inside the double quotes do nothing
special like, hmmm, add more quoting.
--
Well, then let's give that Java-Wussie a beating... (me)
Michael Lamertz | +49 2234 204947 / +49 171 6900 310
Sandstr. 122 | [EMAIL PROTECTED]
50226 Frechen | http://www.lamertz.net
Germany | http://www.perl-ronin.de
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]