Use of uninitialized value $1 in string eq at /usr/share/perl5/Text/Textile.pm line 89 #4

Open
nickleverton opened this Issue Jul 29, 2011 · 3 comments

Projects

None yet

2 participants

@nickleverton

Similar problem to that noted by domm resulting in much noise printed to stderr.

--- /usr/share/perl5/Text/Textile.pm.orig 2009-08-08 19:20:45.000000000 +0100
+++ /usr/share/perl5/Text/Textile.pm 2011-07-29 14:21:57.000000000 +0100
@@ -86,7 +86,7 @@
my $flavor = shift;
$self->{flavor} = $flavor;
if ($flavor =~ m/^xhtml(\d)?(\D|$)/) {

  •        if ($1 eq '2') {
    
  •        if (defined $1 && $1 eq '2') {
             $self->{_line_open} = '<l>';
             $self->{_line_close} = '</l>';
             $self->{_blockcode_open} = '<blockcode>';
    
@nickleverton

360 days later the same issue bites me again on another new server :-( Pretty please could the fix be released ?

@bradchoate
Owner

I'm not sure what the issue here is. Is the flavor method being called somewhere with an undefined value? A small bit of code that reproduces the warning would be helpful.

@nickleverton

Hi Brad,
Thanks for the reply, sorry didn't get back to you sooner as life intervened.
I have a CGI which uses the very excellent Text::Textile and sets flavour() to 'xhtml', which is a valid choice according to the docs. This causes the warning when a textile template is processed and flavour is matchedd by the above code, as $2 is null.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment