in reply to Catch warning from external module

I've tried to use eval{} on function call but it didn't seem to work.

What does the documentation say, how are you supposed to tell when this function fails, and how are you supposed to tell why it fails (an error variable/attribute/method)?

Yes, you can trap warnings in perl, but its not as convenient as eval

local $SIG{__WARN__} = \&catch_warnings; emit_some_warnings(); # catch_warnings($msg) sub catch_warnings { my( $msg ) = @_; print "I caught this warning $msg\n"; }

Whatever this external module is, you should study its documentation :)