Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re^3: Peculiar hash behavior

by LanX (Saint)
on Oct 02, 2021 at 19:07 UTC ( [id://11137202]=note: print w/replies, xml ) Need Help??


in reply to Re^2: Peculiar hash behavior
in thread Peculiar hash behavior

> The array emulation is another one of those things I've read about a few times and never really understood well enough to be safe around :-) .

I think it helps to know that Perl4 had no references˛, so none of the - now normal - nested data-structures described in perldsc were available.

With the introduction of Perl5 multi-dim hashes had to be kept for backwards compatibility, but are for most an unknown or obscure feature.

But they are quite handy sometimes, you'd be surprised how many people tend to reinvent something like $h{ join(",",@dims) }= "x" which is essentially the same without a safer separator.°

HTH! :)

Cheers Rolf
(addicted to the Perl Programming Language :)
Wikisyntax for the Monastery

°) a former boss was particularly proud to show me his "genius" trick to safe memory ...

˛) a lot had to be achieved with *type-globs (yuck)

Replies are listed 'Best First'.
Re^4: Peculiar hash behavior
by dd-b (Monk) on Oct 05, 2021 at 02:36 UTC

    I remember the transition from Perl 3 to Perl 4, yeah. Lots of really useful new features.

      One might think that if you had been using Perl for that long you might have run across this feature before?

      Just sayin'      :)

      You remember Perl 3 ?!? Wait... are you brian d foy? Is this Larry?


      Give a man a fish:  <%-{-{-{-<

        Since Perl 3 was released in October 1989 (see Perl and Perl timeline), I don't believe brian_d_foy could have been a Perl 3 user because, according to this 2005 perl.com article, he began using Perl while studying nuclear physics in grad school. I guess that was around 1995 or so because he mentioned in the article that he bought Programming Perl and Learning Perl in the same week! And these books were not published until 1991 and 1993 respectively. Curiously, brian still has the receipts for the purchase of these classic books. :)

        I suppose we might find the mysterious dd-b lurking among the 205 Perl 3 users who voted for Perl here:

        Surprisingly, merlyn voted against Perl back then! The reason for his eccentric vote is explained here.

        Update: Unfortunately, brian's Learning Perl receipt, mentioned in the 2005 perl.com article, is today a broken link and the 2005 Wayback Machine version of the article retrieves the text namely:

        This is a receipt for the first Learning Perl book I bought. At the time I was working at Brookhaven National Lab, and it looks like I drove out to Stony Brook, probably to go to a sandwich shop that I liked (very little is around Brookhaven). On the way I picked up the Pink Llama.

        but not the graphic of the receipt itself (the price, $24.95, is in the title, but not the date). So the date of purchase remains a mystery.

        Further Update: Woo-hoo, the graphic of the $29.95 receipt for "Programming Perl" is visible! It was bought from Clerk No. 28 at Barnes & Noble, Auburn MA, on Saturday the 24th of June 1995 at 1:45 pm! brian's description: "I bought Programming Perl at the Barnes & Noble on Route 12 in Auburn, MA. I'd take any excuse to get out of Worcester."

        Update: See also: How long have you been using Perl? (no reply from brian_d_foy ... but I like TimToady's response :) Oh, another classic Tim Toady response ... though I love the response to Tim even more :)

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others learning in the Monastery: (3)
As of 2024-04-13 07:29 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found