I'm using File::Slurp
read_file
and write_file
functions to updated a file content.
Now I'm focusing on add error handling to it. For that I tried doing following methods for file that not actually exist.
1) read_file($file) or die("file read failed\n");
Not working. Just throwing Status: 500 software error.
2) try{ my @lines = read_file($file); } catch{ print "file cannot read";};
not working.
3) err_mode just like in http://search.cpan.org/~drolsky/File-Slurp-9999.13/lib/File/Slurp.pm#err_mode
. Not working.
Is it bad idea to use Perl File::Slurp
?
Software error:
For help, please send mail to this site's webmaster, giving this error message and the time and date of the error.
– Yasiru G Oct 22 '15 at 05:25