Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
Hi,
I would like to open a file and if can not open, need to throw a message using Exception handling method(try-catch method).
How can i do that? I have written like this in normal method, how can i convert it try-catch method?
Can anyone post a solution here
Regards,
San
I would like to open a file and if can not open, need to throw a message using Exception handling method(try-catch method).
How can i do that? I have written like this in normal method, how can i convert it try-catch method?
open (FH, "directory/myfile") || die "Can Not open the file"; @array = <FH>; close(FH);
Can anyone post a solution here
Regards,
San
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Exception handling - try Catch Method
by Zaxo (Archbishop) on Aug 27, 2004 at 03:02 UTC | |
Re: Exception handling - try Catch Method
by csuhockey3 (Curate) on Aug 27, 2004 at 04:14 UTC | |
by tachyon (Chancellor) on Aug 27, 2004 at 07:45 UTC | |
Re: Exception handling - try Catch Method
by Rakeswell (Initiate) on Aug 27, 2004 at 05:42 UTC | |
Re: Exception handling - try Catch Method
by ybiC (Prior) on Aug 27, 2004 at 03:30 UTC | |
by adrianh (Chancellor) on Aug 27, 2004 at 08:39 UTC | |
Re: Exception handling - try Catch Method
by reneeb (Chaplain) on Aug 27, 2004 at 06:20 UTC | |
by dragonchild (Archbishop) on Aug 27, 2004 at 11:57 UTC | |
Re: Exception handling - try Catch Method
by Matts (Deacon) on Aug 28, 2004 at 16:02 UTC |
Back to
Seekers of Perl Wisdom