Skip Menu |

This queue is for tickets about the Text-Reflow CPAN distribution.

Report information
The Basics
Id: 119179
Status: resolved
Worked: 10 min
Priority: 0/
Queue: Text-Reflow

People
Owner: martin [...] gkc.org.uk
Requestors: gjtunley [...] gmail.com
Cc:
AdminCc:

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



Subject: Undefined value warning
Date: Thu, 8 Dec 2016 11:13:37 +0000
To: bug-Text-Reflow [...] rt.cpan.org
From: Gareth Tunley <gjtunley [...] gmail.com>
Hi, I am using this module to reflow text from a database to fit into a column in a spreadsheet and am getting lots of: Use of unititialized value within @Text::Reflow::from in string eq at /usr/local/lib/perl/5.18.2/Text/Reflow.pm line 291. Basically I am calling it as follows: foreach my $row (@results_from_db) { $row->{SomeNotesField} = reflow_string( $row->{SomeNotesField} || '', maximum => 80, optimum => 75, ); } You can reproduce this as follows: #!/usr/bin/perl -w use Text::Reflow qw(reflow_string); use strict; use warnings; print reflow_string(''); exit; $ perl -v This is perl 5, version 18, subversion 2 (v5.18.2) built for x86_64-linux-gnu-thread-multi (with 44 registered patches. see perl -V for more detail) $ grep '$Text::Reflow::VERSION' /usr/local/lib/perl/5.18.2/Text/Reflow.pm $Text::Reflow::VERSION = "1.16"; Thanks Gareth -- Gareth Tunley - gjtunley@gmail.com
CC: gjtunley [...] gmail.com
Subject: Re: [rt.cpan.org #119179] Undefined value warning
Date: Thu, 8 Dec 2016 11:22:53 +0000
To: bug-Text-Reflow [...] rt.cpan.org
From: Martin Ward <martin [...] gkc.org.uk>
On 08/12/16 11:13, Gareth Tunley via RT wrote: Show quoted text
> Thu Dec 08 06:13:47 2016: Request 119179 was acted upon. > Transaction: Ticket created by gjtunley@gmail.com > Queue: Text-Reflow > Subject: Undefined value warning > Broken in: (no value) > Severity: (no value) > Owner: Nobody > Requestors: gjtunley@gmail.com > Status: new > Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=119179 > > > > Hi, > > I am using this module to reflow text from a database to fit into a column > in a spreadsheet and am getting lots of: > > Use of unititialized value within @Text::Reflow::from in string eq at > /usr/local/lib/perl/5.18.2/Text/Reflow.pm line 291.
Thanks for the bug report. I have just uploaded version 1.17 to CPAN which should fix this. I changed line 291 in Reflow.pm from: pop(@from) if ($from[$#from] eq ""); to: pop(@from) if @from && ($from[$#from] eq ""); -- Martin Dr Martin Ward STRL Principal Lecturer & Reader in Software Engineering martin@gkc.org.uk http://www.cse.dmu.ac.uk/~mward/ Erdos number: 4 G.K.Chesterton web site: http://www.cse.dmu.ac.uk/~mward/gkc/ Mirrors: http://www.gkc.org.uk and http://www.gkc.org.uk/gkc