On Fri, 25 Oct 2002, Michael Lazzaro wrote:
: What's the Official Perl difference between a named unary op and a 
: one-arg universal method?

The Perl 5 definition of named unary op is an operator with the
precedence of UNIOP in perly.c.

: E.g. why are "temp" and "let" both ops but 
: "my, our, hash" are not?

Well, "temp" and "let" both have their primary function at run time.
"my" and "our" are declarative, so their primary function is at
compile time, though either can function as an lvalue at run time.
So while things like "my" might parse at the same precedence level
as a UNIOP, they're somewhat disqualified by not really being an
operator in the usual sense.  Of course, you can always think of
them as operators that just happen to run immediately at compile time
'cuz they're too impatient to wait for run time.  But they also tend
to require special syntax following them, such as "is", that isn't
allowed in the case of general

"hash {...}" can be considered an operator if "sub {...}" is.
But again, its primary function is to clarify the declarative intent
of the following braces, even though the braces do have a run-time
meaning.  Ordinarily though, the braces are disambiguated by whether
there is => at the top level.

: (I also missed 'err', not sure on that one either.)

Yes, that should be there too.

Larry

Reply via email to