Closed atoomic closed 5 years ago
Noticed this error while trying to replace the content of a file using PPI
I'm using the following environment
Perl 5.26.2 PPI-1.264 Ref-Util-Rewriter-0.003
content of a test.pl file
test.pl
package Foo; use strict; sub blessed { my ($self) = @_; my $is_code = ref $self eq 'CODE'; return ref $self; } 1;
perl -MRef::Util::Rewriter -E 'use Test::More; note "Before:\n", qx[cat test.pl]; Ref::Util::Rewriter::rewrite_file( "test.pl" ); note "After:\n", qx[cat test.pl];' # Before: # package Foo; # # use strict; # # sub blessed { # my ($self) = @_; # # my $is_code = ref $self eq 'CODE'; # # return ref $self; # } # # 1; Can't call method "__insert_before_child" on an undefined value at /usr/local/perl/perls/perl-5.26.2/lib/site_perl/5.26.2/PPI/Element.pm line 515.
similar issue when converting q{ref $foo eq 'CODE' && ref $foo eq 'ARRAY';}
q{ref $foo eq 'CODE' && ref $foo eq 'ARRAY';}
Resolution merged.
Noticed this error while trying to replace the content of a file using PPI
I'm using the following environment
content of a
test.pl
file