You've seen Mark Lentczner's Periodic Table of Perl 6 Operators
http://www.ozonehouse.com/mark/blog/code/PeriodicTable.html

What about one for Perl 5?

Using perlop, opcode.pl and Mark's table I've done step one: drawn up a
complete list of Perl 5 operators.  All 129 of them [1] in no particular
order.
http://www.pobox.com/~schwern/tmp/perl5ops

I've followed Mark's lead as to what is and is not an op.  The -X filetest
operators, despite being in perlfunc, are ops.  "scalar" is listed to
match up with Mark's Contextegens.  "ref", "exists", "delete", etc...
are listed to match up with the Textaveries.  "sub" is not an op, that's
syntax... I guess.  I've asked Mark what his system was for deciding what
is an what is not an op but it seems fairly sensible to me.

So... did I miss anything?

The big step is to work out operator precedence.  perlop has a 24 level
precedence table but I suspect that's perhaps the biggest white lie in all
the Perl docs.  Can Perl 5 even be said to have a simple enough idea of
op precedence to apply a number to each op?  If so, how does one go about
figuring this out?


[1] Mark's table shows 180 ops, but its a year out of date.  If we remove
the bitwise operators we get 153 for Perl 6 and 123 for Perl 5 and things
start to look more sane.

-- 
Michael G Schwern     [EMAIL PROTECTED]     http://www.pobox.com/~schwern
ROCKS FALL! EVERYONE DIES!
        http://www.somethingpositive.net/sp05032002.shtml

Reply via email to