Well, I knew those techniques, but they are what I'm trying to avoid. I'm looking for a more elegant solution, but I guess Perl can't do it. Oh well, I'll have to write it in C then, and it'll probably have to be completely hardware and OS specific (boohoo).
Thanks anyways guys.