>>>>> "Peter" == Peter Marschall <[EMAIL PROTECTED]> writes:
Peter> Hi,
Peter> 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.
Peter> I think this is the correct diagnosis.
Peter> Can you try the attached version of Schema.pm and tell if
Peter> parse() works as documented ?
I run the code of my original posting:
$ ./test0.pl
Never printed at ./test0.pl line 9.
Can't call method "error" without a package or object reference at ./test0.pl line
13.
Or, with the debugger:
main::(./test0.pl:7): my $schema = Net::LDAP::Schema->new;
DB<1> n
main::(./test0.pl:9): $schema->parse( "foobar" )
main::(./test0.pl:10): or warn "Never printed";
DB<1> n
Never printed at ./test0.pl line 9, <IN> chunk 2.
main::(./test0.pl:12): my $r = $schema->parse( "foobar" );
DB<1> n
main::(./test0.pl:13): warn "This is printed" if $r->error();
DB<1> n
Can't call method "error" without a package or object reference at ./test0.pl line
13, <IN> chunk 4.
DB::fake::(/opt/local/lib/Perl5.004_04/lib/perl5/perl5db.pl:2083):
2083: "Debugged program terminated. Use `q' to quit or `R' to restart.";
IMO, that tells that:
- $schema->parse( "foobar" ) now returns undef which is ok, according
to the pod
- We may wonder if it should return undef after all, and how to use
error() then?
I remind you that the original testfile output is:
This is printed at ./test0.pl line 13.
Peter> With this version parse() should return undef on errors as it
Peter> is stated in the pod file.
[...]
I think it did. The problem now is how to use error().
Nevertheless, tx for your fix, Peter!
--
Claude