After the announcement of a date for an official perl 6 release, I decided that was enough motivation to finally get my hands dirty (as opposed to staring at snippets of code and thinking “gosh, that’s cool”).

Despite the jokes and ribs about the lack of a visible end product over the last 15 years (wow), when it comes time to look at perl 6 and start using it, one tends to find that:

  1. there is a lot of stuff in the core
  2. there’s very little stuff outside of core (ie CPAN)
  3. despite the name and superficial differences, it’s not much like perl 5

#1 is mostly cool. There is a huge learning curve, but it’s so nice to finally be able to treat everything as an object, but more importantly to not have to treat everything like a string - like having real objects representing file paths on disk, not strings we throw around and into functions.

#2 makes life hard. Good perl programmers realise that most likely everything they need is in CPAN, and won’t hesitate to reach into it. Without that resource things become very difficult, very quickly.

Part of this is a good difficult. For instance, the core language has a lot of stuff in it that would formerly be implemented as modules. Moose is a good example of that. Not having that forces us to learn (and invent) the new Perl 6 idioms.

#3 is interesting. There’s a lot of smarts in the compiler to help you out when you try to be naive and do things the old way:

➜  perl6 -e 'foreach (@foo)'
===SORRY!=== Error while compiling -e
Unsupported use of 'foreach'; in Perl 6 please use 'for'
at -e:1
------> foreach ⏏(@foo)

To the uninitiated that just seems like a different keyword meaning the same thing, but the error (so polite) at least prompts you to go look at the documentation and find out that there is a lot more to the humble for loop than meets the eye.

To make sure that this learning has some focus, I’m re-implementing an existing script in perl 6. It’s simple enough to be do-able, and hopefully pick up some of the language along the way. Stay tuned.