in reply to mimicing wc and split

What is your reason for keeping core modules out of it? If you have Perl, you should have all of Perl!

If you're willing to keep core modules out of it, there are pure Perl versions of both wc and split available at http://ppt.perl.org/what.html that are more functional than yours are, and are already tested.

(Of course the best solution is to have your friend install Cygwin.)