Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Re: Programmatically Updating Code with PPI

by JadeNB (Chaplain)
on Jan 04, 2010 at 22:51 UTC ( [id://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
Domain Nodelet?
Node Status?
node history
Node Type: note [id://815659]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others wandering the Monastery: (7)
As of 2024-04-23 14:28 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found