in reply to Re^2: When to use eval
in thread When to use eval
I have never used autodie, but my understanding that it just makes functions that normally return false on failure die instead. So if you have this code:
open my $fh, '<', 'filename.txt';
...and you have autodie in use, the code will behave as if it were written like this:
open my $fh, '<', 'filename.txt' or die $!;
Myself, I prefer to be able to see within the code if something is designed to die explicitly or not so I would never use such a contraption as autodie.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^4: When to use eval
by haj (Vicar) on Feb 01, 2024 at 19:30 UTC | |
by stevieb (Canon) on Feb 02, 2024 at 07:32 UTC |