Hah!
A friend and I, who worked tech support together, did this for a while one even. Pretty funny.
Actually, I didn't know perl so well then, so I might have been speaking C-ish. But it worked out.
while(<>) {
if(&listen($_) eq "phone ring") {
&ignore_stupid_people("on phone");
}
}