in reply to Re^4: Maintaining context of the caller
in thread Maintaining context of the caller

It does if you realise that that is what is happening in the context of a conditional. From OP's parenthetical comment it is fairly clear that this particular subtlety of Perl (and Perl has a lot of them) had escaped OP.

I thought it worth making clear that there is no syntactic sugar that will allow OP to select a list or scalar context at run time for the call by using the conditional operator in that particular fashion.


Perl is Huffman encoded by design.
  • Comment on Re^5: Maintaining context of the caller

Replies are listed 'Best First'.
Re^6: Maintaining context of the caller
by revdiablo (Prior) on Jul 04, 2005 at 23:18 UTC
    it is fairly clear that this particular subtlety of Perl (and Perl has a lot of them) had escaped OP

    Indeed, that's true. I included the parenthetical remark to head off any suggestions that the problem was caused by precedence. Since I had ruled that out, I obviously didn't think that was the problem, but I didn't investigate enough to find out what it was. I just assumed it was something Perl wouldn't allow. Your quoted snippet cleared up the exact reason, and I appreciate it.