Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?

Re^4: Stripping Comments from Source

by tomfahle (Priest)
on May 12, 2010 at 15:53 UTC ( #839665=note: print w/replies, xml ) Need Help??

in reply to Re^3: Stripping Comments from Source
in thread Stripping Comments from Source

Have a look at PPI::Document, too:

#!/usr/bin/perl use strict; use warnings; # Straight from the documention use PPI; # Load a document from a file my $Document = PPI::Document->new('My/'); # Strip out comments $Document->prune('PPI::Token::Comment'); # Strip out Pod $Document->prune('PPI::Token::Pod'); # Save the file $Document->save('My/');

Hth, Thomas

Udate: Added code to strip Pod

Replies are listed 'Best First'.
Re^5: Stripping Comments from Source
by Kob (Novice) on May 14, 2010 at 07:40 UTC
    Following your tip, I installed PPI::Document via PPM to see if it would improve on the stripping relative to perltidy. However, this critical step did not work:

    $Document = PPI::Document->new('');

    I guess there is some PPI::Document package I need to get. I'll continue this later.


Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://839665]
[marioroy]: Hello all. After several attempts, am able to move forward and will soon release a Parallel:: ForkManager compatible MCE::Hobo:: Manager, also MCE::Hobo::Simple, and refactored MCE::Hobo engine supporting multiple instances. Wait works beautifully.
[marioroy]: MCE::Shared has been refined that it allows sharing Tie::File and hash objects containing {fh} key.
[marioroy]: It's taken so long to take Hobo to a new level. Threads-like and Parallel:: ForkManager management capaiblities.
[marioroy]: This will complete the 4 years in the making and likely time to move on to something els.
[marioroy]: s/els/else.

How do I use this? | Other CB clients
Other Users?
Others lurking in the Monastery: (8)
As of 2017-05-26 08:28 GMT
Find Nodes?
    Voting Booth?