Posted in: Technical Track

I already knew about git-achievements (and partake in the fun). But earlier this week Dean showed me Unit Testing Achievements.

My first thought after seeing it was: “cool, I want to port that to Smolder!”. My second thought was: “hey, if we can do it for Git, and for testing, why not for Perl itself?” Perl::Critic and Perl::Tidy already use PPI for their magic, surely it wouldn’t be too hard to harness its power for a little bit of fun?

And, indeed, it wasn’t:

[[email protected] ~]$ cat
print "Hello world", $/;
[[email protected] ~]$ alias perl="perl-achievements -r --"
[[email protected] ~]$ perl
Congrats! You have unlocked 1 new achievement
*** Cryptomancer
*** Level 1
Used Perl magic variables.
Variables used: $/
Hello world

The code for this new Perl::Achievements is on Github. For now I was only aiming at churning out a prototype, so the code’s a mess, there’s no documentation whatsoever, and there are only two achievements to unlock. Buuut if I have time, and if it amuses peoples, it would be easy to make it grow into something a little more… interesting.

Want to talk with an expert? Schedule a call with our team to get the conversation started.

No comments

Leave a Reply

Your email address will not be published. Required fields are marked *