On 22/4/04 4:34 pm, Peter Marschall <[EMAIL PROTECTED]> wrote:
> Hi,
>
> On Tuesday 20 April 2004 11:39, Claude wrote:
>> I tried this code which, IMO, confirms that "parse" wrongly does not
>> return "undef" in case of error.
>
> I think this is the correct diagnosis.
>
> Can you try the attached version of Schema.pm and tell if parse() works as
> documented ?
>
> With this version parse() should return undef on errors as it is stated in the
> pod file.
I wasn't sure if the pod was in error, or the code!
> @Chris, Graham,
> if you do not object I'l commit his change after Claude's tests.
I haven't tried the code, but on inspection I'd be surprised if simply doing
this will return undef:
$schema->_error("Foo");
return;
Also, what happens when ->new("schema.ldif") fails to parse the schema in
the LDIF file? I *think* if parse returns undef then there's no way to
figure out where the problem in the LDIF file was. (A problem when there are
maybe a couple of thousand pieces of schema in the file :-)
I do recall making a fix in this area a while back which enabled error
messages to be extracted, so this might have been when the difference
between the code and the docs occurred. My bad, as they say.
Cheers,
Chris