Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Re: Programmatically Updating Code with PPI

by JadeNB (Chaplain)
on Jan 04, 2010 at 22:51 UTC ( #815659=note: print w/replies, xml ) Need Help??


in reply to Programmatically Updating Code with PPI

I don't have PPI installed, so can't test; but I hope you don't mind a few quick questions:
  1. Wouldn't
    my $lexicon = $doc->find(sub { $_[1]->content eq '%Lexicon' }); $lexicon = $lexicon->[0]; # returns an array ref, but in my case, ther +e's only ever one.
    be better as
    my $lexicon = $doc->find_first( ... )
    ?
  2. Does the insert_after call return true?
  3. When $lexicon is returned by find, is it still “part of” $doc? That is, could it be that you're modifying only $lexicon, not $doc?

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others romping around the Monastery: (5)
As of 2020-04-04 00:30 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    The most amusing oxymoron is:
















    Results (32 votes). Check out past polls.

    Notices?