Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked

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

by LanX (Cardinal)
on May 03, 2019 at 13:25 UTC ( #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?

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

How do I use this? | Other CB clients
Other Users?
Others studying the Monastery: (3)
As of 2021-04-17 10:56 GMT
Find Nodes?
    Voting Booth?

    No recent polls found