if( ref($@) || $@ ne '' ) { ... handle exception ... }