Okay, so my central confusion here has to do with not
understanding that the caret gets used *only once* in
a construct like this:

   my $cb =  {
        do if ($^a eq $^b)  {
             "$a";
        } else {
             "$a & $b";
        }
    };
    say $cb( 'a', 'b' );


After $^a is used, then $a is declared, and you use that form.

So, if you think of $^a as just a funny variable name, you'll get
tripped up in the ways I was, because if you use it again in
the sub-blocks of the if/else, it thinks you're trying to tell
it something about the calling signature for the sub-blocks.

You can however use the "$^a" form repeatedly if you're *not*
using any sub-blocks though, as in the ternary form I was playing
with.

I don't think this usage is very well described anywhere, though
you can argue you should just Get It if you understand that the
caret is a twigil.

And I still think the messaging here is more than a little LTA.

Reply via email to