Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options

Re^3: Semantic diff for Perl code

by clueless newbie (Deacon)
on Sep 27, 2017 at 19:17 UTC ( #1200220=note: print w/replies, xml ) Need Help??

in reply to Re^2: Semantic diff for Perl code
in thread Re: Semantic diff for Perl code

I'm uncertain as to how one inserts "$sub" into the new PPI::Document or PPI::Document::Fragment.

Replies are listed 'Best First'.
Re^4: Semantic diff for Perl code
by Anonymous Monk on Sep 27, 2017 at 19:33 UTC
    untested, but try
    my $subdoc = PPI::Document::Fragment->new(\$sub->content); write_to_file($subdoc->serialize(), ...);
      This loses the content of the heredoc. Instead of
      sub Fee { return <<__Fee__; Fee __Fee__ }

      one gets

      sub Fee { return <<__Fee__; }

      Apparently except when the object is a PPI::Token::Heredoc the content method's return doesn't include the contents of any PPI::Token::Heredoc.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1200220]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others taking refuge in the Monastery: (8)
As of 2019-11-14 16:28 GMT
Find Nodes?
    Voting Booth?
    Strict and warnings: which comes first?

    Results (80 votes). Check out past polls.