Larry Wall writes:
> wanted, you still get the length.  If you're worried about the delayed
> operation, you can force numeric context with $x = +@tmp;, just as you
> can force string context with a unary ~.

How often are you likely to do this?  Speaking as a reader of code,
I've always hated unary + in that crocky "this could be a block or an
expression" sense.  I'd prefer a word operator:

  $x = numeric @tmp;

Of course, beginners might think it was like defined():

  if (numeric $x)  # "is $x a number"

We know the return value of that meaning of numeric() would always be
true.  Everything in Perl can be a number if you want it to be. :-)

Then they'd want:

  $x = string @tmp;

and we'd have to tell them that "string" is spelled "".  Then we could
go off on Abbott and Costello crosstalk: 'there isn't one?'  'there
is, and it's spelled ""' 'you did it again!'  'did what again?'  'left
the operator out'  'it is right there!'  etc.

I feel like I'm in one of those sitcom situations where nervous
over-thoughtful boy and girl meet, and one says something like "you
shouldn't sit beside me".  The other asks why, to be told "we'd hold
hands, and there'd be kissing, more holding, more kissing, and we'd
date for a while, get married as we start college, I'd get pregnant,
drop out to take care of the baby, you'd have to work three jobs to
feed us all, your studies would be left behind, I'd grow increasingly
frustrated with the endless pregnancies, turn to drink, spend the
glorious years of our lives in a drunken haze, beat our children, beat
you, go to jail, come out divorced and with an abused kidney that
would require hospitalization for my slow death.  Ken, I don't like
hospital food!"

Nat

Reply via email to