in reply to nonprinting chars

Your main question has already been answered, but if you're looking at replicating Unix-like commands in perl you could do worse than look at Perl Power Tools.

This project has many of the standard Unix commands reimplemented as portable perl scripts.

(Normally I'd suggest Cygwin, but using perl is also fun :)

Steve
---
steve.org.uk