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

$Document = PPI::Document->new(\'print "Hello World!\n"'); $lastVar->insert_after( $Document->find_first('Statement') );
A little more verbose, but much clearer in intent.

Replies are listed 'Best First'.
Re^3: how to add a PPI:Statement to a document?
by Anonymous Monk on Jan 02, 2008 at 07:28 UTC
    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') );