Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change

Re(2): hash, a troublemaker?

by bart (Canon)
on May 12, 2004 at 08:50 UTC ( #352674=note: print w/replies, xml ) Need Help??

in reply to Re: hash, a troublemaker?
in thread hash, a troublemaker?

You seem to be reinventing fields, and, dare I say it, pseudo-hashes, a now deprecated feature where you could (or still can) use the hash syntax to access fields in an array.

Borrowing your example, the internal structure for pseudo-hashes is:

my $record = [ { K_AGE => 1, K_NAME => 2 }, 1001, 'Doraemon' ];
And you can access it like:
print "Name: '$record->{K_NAME}' Age: $record->{K_AGE}\n";
It just works for 5.6.x, still works for 5.8.3 though with a warning, and this feature will be gone from 5.10.0 on. See the docs on fields for more info, including info on what you really should be using instead.

Log In?

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://352674]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (5)
As of 2023-10-04 06:53 GMT
Find Nodes?
    Voting Booth?

    No recent polls found