in reply to A clean die/croak

> Every time I run my program I get the error: "Uncaught exception from user code"

Because diagnostics is (secretly) used by you!

d:\tmp>perl -MCarp -Mdiagnostics -e"croak 'bla'" Uncaught exception from user code: bla at -e line 1. d:\tmp>

see also this SO discussion which I found by simply googling for you...

update

> How do I tell perl not to print this text?

either don't use diagnostics at all ...

... or disable diagnostics before dieing

d:\tmp>perl -Mdiagnostics -e"disable diagnostics; die 'bla'" bla at -e line 1. d:\tmp>

Cheers Rolf
(addicted to the Perl Programming Language :)
Wikisyntax for the Monastery

Replies are listed 'Best First'.
Re^2: A clean die/croak
by Anonymous Monk on Feb 26, 2022 at 13:41 UTC

    I remember the "use diagnistics" line. I had no idea there is a connection. Thanks.