>>>>> "Chris" == Chris Ridd <[EMAIL PROTECTED]> writes:
Chris> On 20/4/04 7:51 am, Claude <[EMAIL PROTECTED]> wrote:
>>>>>>> "Chris" == Chris Ridd <[EMAIL PROTECTED]> writes:
>>
Chris> On 20/4/04 7:21 am, Claude <[EMAIL PROTECTED]> wrote:
>>>> I'll try to rephrase as I didn't get any answer to my previous
>>>> posting.
>>>>
>>>> A call to "parse" does not seem to ever return false when passed a
>>>> phoney file name.
>>>>
>>>> my $schema = Net::LDAP::Schema->new;
>>>> $schema->parse ( "foobar" ) or die "this line is never printed";
>>>>
>>>> Any help?
>>
Chris> Does calling $schema->error() afterwards return anything?
>>
>> No. As if everything was ok.
I was wrong: "error" returns something. I just wrongly assumed (as the
man page suggests) that it would only return a string.
Chris> Well in 0.9902 (the current version) of Schema.pm the error
Chris> method returns something.
This is the version I am using.
DB<3> v
[...cut...]
'Net/LDAP.pm' => '0.31 from /home/bouillin/lib/Perl5.004_04/lib/perl5/Net/LDAP.pm'
'Net/LDAP/ASN.pm' => '0.02 from
/home/bouillin/lib/Perl5.004_04/lib/perl5/Net/LDAP/ASN.pm'
'Net/LDAP/Constant.pm' => '0.02 from
/home/bouillin/lib/Perl5.004_04/lib/perl5/Net/LDAP/Constant.pm'
'Net/LDAP/Message.pm' => '1.07 from
/home/bouillin/lib/Perl5.004_04/lib/perl5/Net/LDAP/Message.pm'
'Net/LDAP/Schema.pm' => '0.9902 from
/home/bouillin/lib/Perl5.004_04/lib/perl5/Net/LDAP/Schema.pm'
Chris> $schema = Net::LDAP::Schema->new;
Chris> $r = $schema->parse("foobar");
Chris> die "This is printed" if $r->error();
I tried this code which, IMO, confirms that "parse" wrongly does not
return "undef" in case of error.
my $schema = Net::LDAP::Schema->new;
$schema->parse( "foobar" )
or warn "Never printed";
my $r = $schema->parse( "foobar" );
warn "This is printed" if $r->error();
[...]
I nicely get the whole error message this way:
my $r = $schema->parse( "foobar" );
warn ( "This error msg is printed: ", $r->error() ) if $r->error();
Tx a lot for your help, Chris!
--
Claude