It seems to me your script should work, since you are reading it line-by-line. My guess is your Perl or OS dosn't have "large-file-support". See Large File Support
Do a "perl -V" and see if you can find the phrase "USE_LARGE_FILES".
line in the OP's code?!? Well, maybe the problem will still be there, but there's a reason why we recommend against doing so all the time. To the OP: just try using a while loop instead. Until you have a fully functional Perl 6 installation available, that is!