Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re(2): hash, a troublemaker?

by bart (Canon)
on May 12, 2004 at 08:50 UTC ( [id://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?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others about the Monastery: (3)
As of 2024-04-24 19:12 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found