Skip Menu |

This queue is for tickets about the WebService-Validator-HTML-W3C-Fast CPAN distribution.

Report information
The Basics
Id: 95037
Status: resolved
Priority: 0/
Queue: WebService-Validator-HTML-W3C-Fast

People
Owner: Nobody in particular
Requestors: chdl [...] aol.com
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: Array reference error
Date: Fri, 25 Apr 2014 07:06:56 -0400 (EDT)
To: bug-WebService-Validator-HTML-W3C-Fast [...] rt.cpan.org
From: chdl [...] aol.com
Hello, This may be caused by the Perl version 5.10.1 After installing both WebService::Validator::HTML::W3C and WebService::Validator::HTML::W3C::Fast and trying your example code as well as my own I receive, Can't use an undefined value as an ARRAY reference When the script hits the error block foreach my $error ( @{$v->errors} ) { printf("%s at line %d\n", $error->msg, $error->line); } This error is reported in both scripts. Perl version Perl version v5.10.1 Operating system CentOS Linux 6.4 Linux 2.6.32-358.23.2.el6.x86_64 on x86_64 Thank you and keep up the good work :-) Andrew
On Fri Apr 25 21:07:05 2014, chdl@aol.com wrote: Show quoted text
> Hello, > > This may be caused by the Perl version 5.10.1 > > After installing both WebService::Validator::HTML::W3C and > WebService::Validator::HTML::W3C::Fast > and trying your example code as well as my own I receive, > > Can't use an undefined value as an ARRAY reference > > When the script hits the error block > > foreach my $error ( @{$v->errors} ) { > printf("%s at line %d\n", $error->msg, > $error->line); > } > > > This error is reported in both scripts. > > > Perl version Perl version v5.10.1 > Operating system CentOS Linux 6.4 > Linux 2.6.32-358.23.2.el6.x86_64 on x86_64 > > > Thank you and keep up the good work > > :-) Andrew
Hi Andrew, Thanks for the bug report. This module unfortunately only overrides the new() method and provides some helper code. The vast bulk of the work is done by Struan's module. I suspect the problem is in his error() function. If you look at http://cpansearch.perl.org/src/STRUAN/WebService-Validator-HTML-W3C-0.28/lib/WebService/Validator/HTML/W3C.pm and search for "sub errors", you can see he returns "undef" when the recipient expects an reference to a list. It looks like he returns "undef" when there is an serious error occurring in the usage of the module, such as XML::XPath is not installed, or there are no errors (is_valid returned true). Does this help you? Cheers Dave
Subject: Re: [rt.cpan.org #95037] Array reference error
Date: Fri, 25 Apr 2014 08:00:41 -0400 (EDT)
To: bug-WebService-Validator-HTML-W3C-Fast [...] rt.cpan.org
From: chdl [...] aol.com
Hello Dave, Thank you for the fast reply and yes it does or there are no errors (is_valid returned true). Does this help you? I have come to the same conclusion, shall modify the W3C module Many thanks for your help and Happy Coding :-) Andrew Show quoted text
-----Original Message----- From: David Dick via RT <bug-WebService-Validator-HTML-W3C-Fast@rt.cpan.org> To: chdl <chdl@aol.com> Sent: Fri, 25 Apr 2014 13:31 Subject: [rt.cpan.org #95037] Array reference error <URL: https://rt.cpan.org/Ticket/Display.html?id=95037 > On Fri Apr 25 21:07:05 2014, chdl@aol.com wrote:
> Hello, > > This may be caused by the Perl version 5.10.1 > > After installing both WebService::Validator::HTML::W3C and > WebService::Validator::HTML::W3C::Fast > and trying your example code as well as my own I receive, > > Can't use an undefined value as an ARRAY reference > > When the script hits the error block > > foreach my $error ( @{$v->errors} ) { > printf("%s at line %d\n", $error->msg, > $error->line); > } > > > This error is reported in both scripts. > > > Perl version Perl version v5.10.1 > Operating system CentOS Linux 6.4 > Linux 2.6.32-358.23.2.el6.x86_64 on x86_64 > > > Thank you and keep up the good work > > :-) Andrew
Hi Andrew, Thanks for the bug report. This module unfortunately only overrides the new() method and provides some helper code. The vast bulk of the work is done by Struan's module. I suspect the problem is in his error() function. If you look at http://cpansearch.perl.org/src/STRUAN/WebService-Validator-HTML-W3C-0.28/lib/WebService/Validator/HTML/W3C.pm and search for "sub errors", you can see he returns "undef" when the recipient expects an reference to a list. It looks like he returns "undef" when there is an serious error occurring in the usage of the module, such as XML::XPath is not installed, or there are no errors (is_valid returned true). Does this help you? Cheers Dave
Closing ticket