in reply to regex and sysread
When you want to do things in perl, try the simplest thing that could possibly work - it often does.