> -----Original Message-----
> From: JupiterHost.Net [mailto:[EMAIL PROTECTED]
> Sent: Thursday, December 02, 2004 7:06 PM
> To: [EMAIL PROTECTED]
> Subject: Re: Spam:Re: using $! for die()ing with Package function
>
>
> > I don't think you can't set $! since it is a system var.
> Perhaps you could
> > do something like:
> >
> > my $err_text;
> >
> > die $err_text if !Foo();
> >
> > sub Foo_baz
> >     {
> >     return 1 if shift;
> >     $err_text = "Your error message."
> >     return 0;
> >     }
>
> Thanks Ron, yeah if I want to I'll have to probabblly use the old error
> var route. I just wanted to avoid having a special error var tokeep
> track of and die()ing in the function itself. (IE let them kill
> themselves not have me do it :)

NP Jupiter.  Something I do is use the __DATA__ to store error numbers and
messages. I parse it to find the error number and return the text.  'Course,
that means you have to try to anticipate the trouble your users could get
themselves into....Always an impossible task.  But, you could catch general
errors and at least give them some place to start looking for their issues.



-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to