Why does Try::Tiny's "try {}" seem different from "eval {}" for objects created inside the try block?
I have the following initialisation code in a system tray applet: use Gtk3 -init; use Glib::Object::Introspection; eval { Glib::Object::Introspection->setup( basename => 'Notify', version => '0.7', package => "MyProgram::Notify", ); }; if ($@) { say "no notify because setup failed: $@"; $use_notify = 0; } else { MyProgram::Notify->init(); } That code is based upon fdpowermon, but seems to come more or less from the Exception handling examples in the POD of Glib::Object::Introspection. But perlcritic (at level 3) argues about it: Return value of eval not tested at line … So I tried to rewrite t
0 upvotes
View original discussion ↗
Comments
Sign in or sign up to comment and upvote.
No comments yet.