in reply to Error Handling with Packages
Hi Dru,
I had such problems. I tried to avaoid it this way. All my custom packages functions will return me two variable instead of one. For eg:
There are lot of other ways to do it too. But i found this to be easier for me.
I had such problems. I tried to avaoid it this way. All my custom packages functions will return me two variable instead of one. For eg:
#Function inside a package sub test() { ... ... open(FILE,"filename") || return (1,"Error while trying to open the fil +e filename"); .... return (0,UNDEF); } # Main Program my ($result,$err)=test(); Now based on the return value i decide to print the error or take corr +ective messures
There are lot of other ways to do it too. But i found this to be easier for me.
Thanks
SasiKumar
SasiKumar
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: Error Handling with Packages
by salva (Canon) on May 23, 2005 at 19:00 UTC | |
by anjoschu (Sexton) on May 24, 2005 at 08:55 UTC |
In Section
Seekers of Perl Wisdom