in reply to Re: warning: use of uninitialized value
in thread warning: use of uninitialized value
Hello robby_dobby,
You make many good points. I would add:
But I find this comment a bit strange:
I see this convention of if(open($filehandle, "filename") || die $!) - this is really odd style. This means that whatever happens, straight or exceptional flow, go ahead an process this file.
Of course, the if is entirely redundant here. But surely, if the code throws an exception (i.e., die is called), the file will never be processed?
17:11 >perl -Mstrict -wE "say 'Ok 1'; if (open(my $fh, 'nonexistent.tx +t') || die $!) { say 'Ok 2'; } say 'Ok 3';" Ok 1 No such file or directory at -e line 1. 17:11 >
Or have I misunderstood what you’re saying?
| Athanasius <°(((>< contra mundum | Iustus alius egestas vitae, eros Piratica, |
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: warning: use of uninitialized value
by Discipulus (Canon) on Jun 25, 2015 at 09:40 UTC | |
|
Re^3: warning: use of uninitialized value
by robby_dobby (Hermit) on Jun 25, 2015 at 08:02 UTC |