You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
After changing the contents of a PPI::Token::QuoteLike::Words element with the set_contents method, it seems that the changed contents is not reparsed and internal meta-data not updated. This leads to a call to literal returning wrong results.
The below MWE program
#!/usr/bin/env perluse v5.24;
use strict;
use warnings;
use Data::Dumper;
use PPI;
my$doc = PPI::Document->new(\q!my @a = qw( 1 2 3);!);
my$qw = $doc->find_first('PPI::Token::QuoteLike::Words');
print Dumper([ $qw->literal ], $qw);
$qw->set_content($qw->content =~ s/ 2//r);
print Dumper([ $qw->literal ], $qw);
first returns the tokens 1,2,3 as expected, but the second time returns 1 and 3).
The text was updated successfully, but these errors were encountered:
After changing the contents of a
PPI::Token::QuoteLike::Words
element with theset_contents
method, it seems that the changed contents is not reparsed and internal meta-data not updated. This leads to a call toliteral
returning wrong results.The below MWE program
first returns the tokens 1,2,3 as expected, but the second time returns
1
and3)
.The text was updated successfully, but these errors were encountered: