On Tue Jun 07 18:34:06 2011, chm wrote: > Using the FILTER_ONLY with code_no_comments fails for the following > code because the $pod_or_DATA regex does not correctly capture the > pod sequence. It appears to capture up to the = of the last =cut > leaving a naked cut behind which is parses as an undeclared sub. > > > my $dims = pdl($var->dims); > > ($t = $dims->(0)) .= 1; > > $rpt = $dims->prod; > > > > =begin WHENCOMPLEXVALUESWORK > > > > if( UNIVERSAL::isa($var,'PDL::Complex') ) { > > $rpt = $var->dim(1); > > $t = 'complex' > > } else { > > $t = type $var; > > } > > > > =end WHENCOMPLEXVALUESWORK > > > > =cut > > > > barf "Error: wfits() currently can not handle PDL::Complex arrays > (column $colnames[$i])\n" > > if UNIVERSAL::isa($var,'PDL::Complex'); > > $t = $var->type; > > > > $t = $bintable_types{$t}; > > Changing the following line in the regex from > > | ^=begin \s* (\S+) .*? \n=end \s* \1 .*? $EOP > > to > > | ^=begin \s+ (?:\S+) .*? \n=end \s* \1 .*? $EOP =cut \s*? $EOP > > appears to fix the problem. I am not sure that the fix > completely handles all edge cases but I believe it is a > step to the correct solution. I’ve fixed it with commit 0b2be16900832ccd9de494ff538bf070d8623089. (The other issue you reported I have not fixed. I believe it’s a Text::Balanced bug.)Thread Next