Slash Boxes
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

use Perl Log In

Log In

[ Create a new account ]

schwern (1528)

  (email not shown publicly)
AOL IM: MichaelSchwern (Add Buddy, Send Message)

Schwern can destroy CPAN at his whim.

Journal of schwern (1528)

Monday May 16, 2005
10:35 PM

Perl 5 operator list

[ #24726 ]

I stumbed across some guy's blog using the Periodic Table of Perl 6 Operators as evidence that Perl 6 is too complicated. I've seen this sort of thing a lot with regard to Perl 6. I suspect that its just the fact that nobody's ever tried to actually lay out Perl's operator table before and he's in shock seeing it for the first time. I highly suspect Perl 5's would be much, much worse. So I decided to find out.

Perl 6 (according to the Table) has 18 levels of precedence... with some cheats. Perl 5 (according to perlop) has 24... not counting the cheats. And I suspect 24 isn't even quite truthful.

I then counted up all of Perl 5's operators using the same standard as for the Perl 6 table. Pretty much everything that matches /\W/ which isn't syntax, plus a few word ops (and, not...), some op-like things (ref, defined...) and some ops we traditionally think of as functions (-r, -w...). The point was to produce something similar in spirit to the Perl 6 Table for comparison. I haven't produced the table but I have created a big list of all Perl 5 ops. 128. The Perl 6 Table weighs in at 180 (153 if you remove all the bitwise munching ops). Figuing out Perl 5's precedence should be, umm... interesting.

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
More | Login | Reply
Loading... please wait.