in reply to Aren't there code refs as well as function refs?

That's a very confusing question: code-ref and function-ref are used synonymously.

This a ref of a named function

This a ref of a anonymous function

This is a code-block and not (necessarily) in a function, they are important for scooping and as syntactic element like for if, map or sub (sic) Not to be confused with an anonymous hash ref

(Code-blocks and anonymous hash references are distinguished by "looks-like guessing")

Curlies are also used for explicitly marking symbol names after sigils

A special syntactic sugar comes with are prototype (&) for arguments. One can skip the sub when passing an anonymous code-ref

After defining

you can write instead of And calling bar will fail at compile time if anything else than a code ref is passed.

THAT'S ALL!

This should be a list of all uses of curly brackets in Perl (omitting sublanguage syntax like regex)

Please explain what you don't understand.

Cheers Rolf
(addicted to the 𐍀𐌴𐍂𐌻 Programming Language :)
Wikisyntax for the Monastery

Replies are listed 'Best First'.
Re^2: Aren't there code refs as well as function refs?
by tobyink (Canon) on Mar 05, 2023 at 14:04 UTC
      yeah, but
      • quote-like delimiters are a wildmark which fit everywhere
      • hash-keys - OK you are right - they belong to the already mentioned domain of hashes
      • in-string metas for unicode are a sub-language like the afore-mentioned regex, there might be even more like sprintf or formats
      and I also didn't mention dereferencing @{...} etc., but those belong to the same domain like @{name} and the un-strict symbolic derefs @{"na"."me"}

      in short: outside strings (and offsprings like regex) are curlies meant for the domains of

      • code-blocks
      • hashes
      • grouping of variable-symbols/refs

      Cheers Rolf
      (addicted to the 𐍀𐌴𐍂𐌻 Programming Language :)
      Wikisyntax for the Monastery

        Technically the contents of ${...}, @{...}, %{...}, *{...}, and $#{...} are blocks, so you already covered them.

        use v5.10; no strict 'refs'; our $abc = 123; say ${ my @name = qw/a b c/; join q//, @name; };