Android Phone Power Key in Perl

I've got my Android Phone for more than two years now, recently I've
managed to get a good number of tools running on it, including VIM &
Perl5, but the Power key seems not responding well, so I think it a
good idea to be able to control it in a script.