http://www.perlmonks.org?node_id=994127


in reply to Detecting declaration type?

I think this is what you're looking for : ref