in reply to Re^2: Trouble iterating through a hash
in thread Trouble iterating through a hash
Also other "tweaking" of the die message can be done. There is a difference between die "xyzzy" and die "xyzzy\n" This controls whether or not the user gets the Perl line of code number. Sometimes, it can confuse users if too much info is given with terminology that they don't understand.
update:###### with auto die ###### open XXX, '<', "XXX"; #Can't open 'XXX' for reading: 'No such file or directory' at C:\Proje +cts_Perl\testing\die_messasges.pl line 7 ###### without auto die ### # trailing \n in the die message suppresses the line number. open XXX, '<', "XXX" or die "couldn't open Config file, XXX!\n"; # couldn't open Config file, XXX! open XXX, '<', "XXX" or die "couldn't open XX file!"; #couldn't open XX file! at C:\Projects_Perl\testing\die_messasges.pl l +ine 5. open XXX, '<', "XXX" or die "couldn't open config file XX!, $!"; # couldn't open config file XX!, No such file or directory at C:\Proje +cts_Perl\testing\die_messasges.pl line 6.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: Trouble iterating through a hash
by NetWallah (Canon) on Mar 09, 2017 at 06:59 UTC |