wheninstead of the single-line modifier form of
ifreally makes me happy. (Yes, I know
whenis available in 5.10, but that's not the idiom I'm comfortable using in Perl 5.)
There's only one problem: this isn't actually usable in Rakudo yet. I might have the
$*INpart incorrect, but I changed it to use a filehandle for input and print out each line of the file it read during the for loop. And when I ran it on the 10 meg data file I needed to analyze, it just sat there. I believe it was probably trying to read the entire file before doing anything with it, as laziness isn't implemented yet. Between that and Rakudo's lack of speed, the script was a no-go, and I ended up rewriting the script in Perl 5.
PS Before actually posting this, I actually ran the Perl 6 version to completion and timed it. 88 minutes. That's versus less than a second for the Perl 5 version. In fact, I actually wrote and executed the Perl 5 version in considerably less time than it would have taken to just run the Perl 6 version. Also (as sharp eyes may have noticed), I forgot that spaces in regexes are ignored in Perl 6, so the Perl 6 version was in fact incorrect. Getting a working version would have required at least another 88 minutes of sitting there....