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

return new hashref

Thread Next
Jan Gruber
March 1, 2002 04:39
return new hashref
Message ID:
Hi, List !

I'm trying to build a linked list, containing hashrefs.
Walking through the %HashRef (-x %HashRef) i can see a lot of 
'REUSED_ADDRESS'es in the list. At the end, all refs point to one single 
adress, so every HashRef in my list points to the same hash.

I have considered trying the OO way, but this would require a major rewrite 
of the program. This could be done later on, but for the moment, i would be 
happy with another way. 

How do i return a new (read: different) Hashref from a sub on each call ?
cat /dev/world | perl -e "while (<>) {(/(^.*? \?) 42 \!/) && (print $1)}"

Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About