Skip Menu |

This queue is for tickets about the HTML-EditableTable CPAN distribution.

Report information
The Basics
Id: 59181
Status: resolved
Priority: 0/
Queue: HTML-EditableTable

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

Bug Information
Severity: Important
Broken in: 0.12
Fixed in: 0.20



CC: davidnicol [...] gmail.com
Subject: Need option to output to string
There does not seem to be a way to get a string out of the table object, when you want to put the table in a string instead of directly sending it to STDOUT. Which is a very important feature that allows insertion of EditableTable elements into templates. I don't know how deep of a refactoring adding that feature will take, but I was surprised that the htmlDisplay method was not a wrapper around such. Possible APIs would include letting htmlDisplay take an optional argument which would be where the output goes, defaulting to stdout, or a new method, htmlString, and making htmlDisplay a wrapper around that: sub htmlDisplay{ print $_[0]->htmlString } I think there is a way in newer perls to open a virtual file handle to a string, which would allow htmlString to wrap the current htmlDisplay --- sub HTML::EditableTable::htmlString { local *STDOUT; my $buffer; open STDOUT, '>', \$buffer or die "Can't reopen STDOUT to buffer: $!"; $_[0]->htmlDisplay; close STDOUT; # might not be needed $buffer }