Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re^2: Tutorial RFC: Guide to Perl references, Part 1

by LanX (Saint)
on May 03, 2019 at 17:25 UTC ( [id://1233324]=note: print w/replies, xml ) Need Help??


in reply to Re: Tutorial RFC: Guide to Perl references, Part 1
in thread Tutorial RFC: Guide to Perl references, Part 1

> curly braces have two different purposes. One is to dereference arrays and hashes. For example

curly braces have more purposes

  • grouping blocks like if (1) { CODE }
  • literal anonymous hashes $href = { KEY => VALUE }
  • accessing hash keys $href->{KEY} or $hash{KEY}

This my %myhash = %{ $href } ; is just a form of grouping like in the first example to clarify the precedence.

Which doesn't make much sense here since my %myhash = %$href ; has the exact same effect.

And it's not the curly which does the dereference, but the %sigil.

Cheers Rolf
(addicted to the Perl Programming Language :)
Wikisyntax for the Monastery FootballPerl is like chess, only without the dice

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others cooling their heels in the Monastery: (7)
As of 2024-04-16 10:10 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found