Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re: how to add a PPI:Statement to a document?

by Anonymous Monk
on Dec 29, 2007 at 11:39 UTC ( #659467=note: print w/ replies, xml ) Need Help??


in reply to how to add a PPI:Statement to a document?

Watch carefully

$Document = PPI::Document->new(\'print "Hello World!\n"'); $lastVar->insert_after( $Document );


Comment on Re: how to add a PPI:Statement to a document?
Download Code
Re^2: how to add a PPI:Statement to a document?
by Anonymous Monk on Jan 02, 2008 at 07:20 UTC
    $Document = PPI::Document->new(\'print "Hello World!\n"'); $lastVar->insert_after( $Document->find_first('Statement') );
    A little more verbose, but much clearer in intent.
      In fact, you also should just throw away the other document immediately.
      $lastVar->insert_after( PPI::Document->new('print "Hello World!\n")->f +ind_first('Statement') );

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (12)
As of 2014-07-23 19:23 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite superfluous repetitious redundant duplicative phrase is:









    Results (152 votes), past polls