Pugs…finally!

13Apr06

Yay, I’ve finally managed to start playing around with Pugs, the Perl6 interpreter of choice till Parrot is ready. Performance-wise, it’s not as bad as I thought it was going to be.

There’s some really good stuff in the examples/ directory to show off Perl6 syntax. I immediately gravitated to the naive_bayesian directory, which shows a simple text classifier implemented in both Perl5 and Perl6. I wasn’t getting the right output from the Perl5 classifier, so I dug around and (drumroll please!) found that $0 has a different meaning in Perl5 than Perl6: in Perl5, it is the name of the script being run, while $1, $2, etc. are the names of matches in a regexp. In Perl6, apparently, $0 is the first match in a regexp and is no longer the name of the script being run, so anyone using it that way is going to get an undef. I know I use $0 a lot in my scripts, though mostly for harmless things like printing log messages, so hopefully this won’t be a deal-breaker in transitioning to Perl6.

(Of course, there’s the chance this has been explored and expounded upon in great detail already and I’m simply unaware of it. What can I say, I’m on a plane.)

(A plane, by the way, that claims they have no power sockets anywhere. Not Business Class, not First Class. They’re either liars or this airline is severely substandard. Given that we’ve already suffered a 2 hour delay at Heathrow, I’m leaning towards the latter.)

0 Responses to “Pugs…finally!”


  1. No Comments

Leave a Reply


Comment guidelines: No spamming, no profanity, and no flaming. Inappropriate comments will be deleted outright.