Skip Menu |
 

This queue is for tickets about the Template-Provider-Encoding CPAN distribution.

Report information
The Basics
Id: 27645
Status: resolved
Priority: 0/
Queue: Template-Provider-Encoding

People
Owner: Nobody in particular
Requestors: nferraz [...] gmail.com
Cc:
AdminCc:

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



Subject: Warning
Download (untitled) / with headers
text/plain 1.4k
This is not an error, but a warning that appears hundred of times when I run a project using "-w": Use of uninitialized value in pattern match (m//) at /Library/Perl/5.8.6/Template/Provider/Encoding.pm line 33. Use of uninitialized value in subroutine entry at /Library/Perl/5.8.6/Template/Provider/Encoding.pm line 24. Use of uninitialized value in pattern match (m//) at /Library/Perl/5.8.6/Template/Provider/Encoding.pm line 33. Use of uninitialized value in subroutine entry at /Library/Perl/5.8.6/Template/Provider/Encoding.pm line 24. Use of uninitialized value in pattern match (m//) at /Library/Perl/5.8.6/Template/Provider/Encoding.pm line 33. Use of uninitialized value in subroutine entry at /Library/Perl/5.8.6/Template/Provider/Encoding.pm line 24. Use of uninitialized value in pattern match (m//) at /Library/Perl/5.8.6/Template/Provider/Encoding.pm line 33. Use of uninitialized value in subroutine entry at /Library/Perl/5.8.6/Template/Provider/Encoding.pm line 24. Use of uninitialized value in pattern match (m//) at /Library/Perl/5.8.6/Template/Provider/Encoding.pm line 33. Use of uninitialized value in subroutine entry at /Library/Perl/5.8.6/Template/Provider/Encoding.pm line 24. Here's a possible solution: 33 $data->{text} ||= ''; # avoid undefined value warnings 34 my $encoding = $data->{text} =~ /^\[% USE encoding '([\w\-]+)'/ 35 ? $1 : $self->{DEFAULT_ENCODING}; In other words: define $data->{text} before testing it.
Subject: Re: [rt.cpan.org #27645] Warning
Date: Tue, 19 Jun 2007 11:47:44 -0700
To: bug-Template-Provider-Encoding [...] rt.cpan.org
From: "Tatsuhiko Miyagawa" <miyagawa [...] gmail.com>
Do you know in what circumstance $data->{text} can be undefined? On 6/19/07, via RT <bug-Template-Provider-Encoding@rt.cpan.org> wrote: Show quoted text
> > Tue Jun 19 14:14:56 2007: Request 27645 was acted upon. > Transaction: Ticket created by NFERRAZ > Queue: Template-Provider-Encoding > Subject: Warning > Broken in: 0.09 > Severity: Normal > Owner: Nobody > Requestors: nferraz@gmail.com > Status: new > Ticket <URL: http://rt.cpan.org/Ticket/Display.html?id=27645 > > > > This is not an error, but a warning that appears hundred of times when I > run a project using "-w": > > Use of uninitialized value in pattern match (m//) at > /Library/Perl/5.8.6/Template/Provider/Encoding.pm line 33. > Use of uninitialized value in subroutine entry at > /Library/Perl/5.8.6/Template/Provider/Encoding.pm line 24. > Use of uninitialized value in pattern match (m//) at > /Library/Perl/5.8.6/Template/Provider/Encoding.pm line 33. > Use of uninitialized value in subroutine entry at > /Library/Perl/5.8.6/Template/Provider/Encoding.pm line 24. > Use of uninitialized value in pattern match (m//) at > /Library/Perl/5.8.6/Template/Provider/Encoding.pm line 33. > Use of uninitialized value in subroutine entry at > /Library/Perl/5.8.6/Template/Provider/Encoding.pm line 24. > Use of uninitialized value in pattern match (m//) at > /Library/Perl/5.8.6/Template/Provider/Encoding.pm line 33. > Use of uninitialized value in subroutine entry at > /Library/Perl/5.8.6/Template/Provider/Encoding.pm line 24. > Use of uninitialized value in pattern match (m//) at > /Library/Perl/5.8.6/Template/Provider/Encoding.pm line 33. > Use of uninitialized value in subroutine entry at > /Library/Perl/5.8.6/Template/Provider/Encoding.pm line 24. > > > Here's a possible solution: > > 33 $data->{text} ||= ''; # avoid undefined value warnings > 34 my $encoding = $data->{text} =~ /^\[% USE encoding '([\w\-]+)'/ > 35 ? $1 : $self->{DEFAULT_ENCODING}; > > > In other words: define $data->{text} before testing it. >
-- Tatsuhiko Miyagawa
Subject: Re: [rt.cpan.org #27645] Warning
Date: Tue, 19 Jun 2007 20:38:51 +0100
To: bug-Template-Provider-Encoding [...] rt.cpan.org
From: Nelson Ferraz <nferraz [...] gmail.com>
Download (untitled) / with headers
text/plain 326b
Show quoted text
> Do you know in what circumstance $data->{text} can be undefined?
Not right now -- I just got involved on this project, and I noticed this behavior when I ran it for the first time. It isn't a big problem, but since it happened once, and there's a simple solution, I thought I should open a ticket and submit a patch.
From: MSTROUT [...] cpan.org
Download (untitled) / with headers
text/plain 242b
On Tue Jun 19 14:48:39 2007, miyagawa@gmail.com wrote: Show quoted text
> Do you know in what circumstance $data->{text} can be undefined?
The last possible case in Template::Provider::_load is ($data, $error) = (undef, Template::Constants::STATUS_DECLINED)


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.