another possibility just thought of: most tv / radio cards come with a infrared module and a remote. linux has a standard kernel module for IR..and then you just interface to it with perl, something along the lines of http://www.thekramers.net/ir/
check out the debian hardware compatibility list to obtain a supported TV/radio tuner with IR.