When I try to use PDF::Table module on Debian Jessie (Perl 5.20), I get this message:
Useless use of greediness modifier '?' in regex; marked by <-- HERE in m/(\S{20}? <-- HERE )(?=\S)/ at /usr/share/perl5/PDF/Table.pm line 370.
This module works great on Debian Wheezy (with Perl 5.014002) but an upgrade in Perl 5.20 seems to make it unusable on Debian Jessie. The only documentation I found on this bug talks about the Perl upgrade, but doesn't give any solution to fix that. The script I use is the PDF::Table main example on CPAN:
use strict;
use warnings;
use PDF::API2;
use PDF::Table;
my $pdftable = new PDF::Table;
my $pdf = new PDF::API2(-file => "table_of_lorem.pdf");
my $page = $pdf->page;
# some data to layout
my $some_data =[
["1 Lorem ipsum dolor",
"Donec odio neque, faucibus vel",
"consequat quis, tincidunt vel, felis."],
["Nulla euismod sem eget neque.",
"Donec odio neque",
"Sed eu velit."],
#... and so on
];
my $left_edge_of_table = 50;
# build the table layout
$pdftable->table(
# required params
$pdf,
$page,
$some_data,
x => $left_edge_of_table,
w => 495,
start_y => 500,
start_h => 300,
# some optional params
next_y => 750,
next_h => 500,
padding => 5,
padding_right => 10,
background_color_odd => "gray",
background_color_even => "lightblue", #cell background color for even rows
);
$pdf->saveas("table_of_lorem.pdf");
print "Content-type: text/html\n\n";
print "Ok";
My hoster only says that I have to "adapt my code"... Can you please help me to find the right way to do that? I only noticed this bug when using PDF::Table, but is there a possibilty to have the same problem with another Perl module on Perl 5.20? Thank you very much for your help!