On Tue, 16 Dec 2003, Joe Schaefer wrote:

> Dave Rolsky <[EMAIL PROTECTED]> writes:
>
> > If you call Apache::Request->instance with an undefined value, it dies
> > when it tries to call pnotes() on that argument.
> >
> > It seems to me that it should simply return a false value if given
> > undef. This can happen if you have a piece of code like this:
> >
> >  my $r = Apache::Request->instance(Apache->request);
> >
> > which may be called during server startup or during a request.
>
> Would something like this be ok?
>
>   sub instance {
>     my ($class, $r) = @_;
>     return undef unless defined $r;

Returning undef is kind of annoying, since it's true in list context.  A
bare return is better, IMHO.


-dave

/*=======================
House Absolute Consulting
www.houseabsolute.com
=======================*/

-- 
Reporting bugs: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html

Reply via email to