Strange Loops

No Matter Where You Go, There You Are

A Perl6 Preview

| Comments

I’m excited about the impending Perl6 release (in 2007!) and Pugs has given me an opportunity to preview Perl6. I suspect that Pugs will take on a life of it’s own even with the release of a Perl6. I used Perl 6 and Parrot Essentials as my guide through this journey but on hindsight the synopses and example code were sufficient. In fact, the synopses were better than the book as they are more up to date and the Pugs people are coding to the synopses.

What in Perl6 appeals to me right now? (Or what I wish was in Perl today). Mostly it’s the way Perl6 is going to handle function arguments (coming from a C background, Perl’s argument passing has always weirded me out)



  1. Formal parameters are the biggest win for me. I can now name the parameters I pass to my Perl6 subroutines. The use of @_ is now a special case.

  2. Arrays and hashes won’t be flattened by default. Array/ArrayRefs are passed transparently to functions as arrays. Same with hashes. To get the Perl behaviour, I believe that is what the asterisk * operator is for. (And no, asterick doesn’t mean typeglob, it looks like typeglobs have been removed from the language). I read this in the book but haven’t tried it with Pugs yet.

  3. multi subs are cool especially after you’ve worked with Haskell pattern matching. Pugs does something very similar (checkout the fp.p6 example file).


Lots of cool stuff to play with (“say”, junctions, Haskell implementation) but that’s all the time I have to try Pugs for now.