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


in reply to Re^5: Best way to check if something is a file handle?
in thread Best way to check if something is a file handle?

It also fails for IO::All, but yes, format_name seems to be a good choice of an innocuous method for evaling.

I don't think there's any silver bullet. :-(

perl -E'sub Monkey::do{say$_,for@_,do{($monkey=[caller(0)]->[3])=~s{::}{ }and$monkey}}"Monkey say"->Monkey::do'