in reply to Re: beginner question - why is hash key unquoted and in capitals
in thread beginner question - why is hash key unquoted and in capitals

Hi If nothing is being dereferenced, can you tell me what is going on? Why are there 2 adjacent pairs of curly braces? I thought when you say that it meant there was an implicit -> operator? I am probably wrong and have only just read about references today. I understand the concept but find the notation confusing thanks
  • Comment on Re^2: beginner question - why is hash key unquoted and in capitals

Replies are listed 'Best First'.
Re^3: beginner question - why is hash key unquoted and in capitals
by kennethk (Abbot) on Oct 16, 2010 at 15:31 UTC
    $sub{$dir}{CALLBACK} is short hand for $sub{$dir}->{CALLBACK}, and they are literally equivalent. Any time an array or a hash contain array or hash references, you can use that notation. This is discussed in Arrow Rule in perlreftut.

    The value held in $sub{$dir} is being dereferenced as a hash, and then the value stored with key CALLBACK is being set to $callback. I find halfcountplus's statement on this misleading at best.

      Hi, thanks for answering. That is what I thought but the other comment confused me (and a beginner is easily confused!)