mw has asked for the wisdom of the Perl Monks concerning the following question:
Recently I stepped out on the path of upgrading my brane from Korn Shell and associated utilities to Perl. My learning was greatly assisted by this document, which I can recommend up to the point of OO.
One of the constructs I often use in ksh is:remove_cruft() { ... sed, sed, awk! awk! awk! } cat $HTML_FILE | remove_cruft >$OUTPUT_FILE
I have a library of HTML tools that create stylesheets, change all H1's to H2's, remove unwanted tags and so on, which I'm porting to perl now. I'd like to know what the preferred method is to filter the output of a perl sub through another perl sub. Or maybe, the problem is approached in a completely different manner.
Any words of wisdom greatly appreciated.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Filters within a filter...
by Tanktalus (Canon) on Feb 04, 2005 at 16:29 UTC | |
by mw (Sexton) on Feb 04, 2005 at 16:54 UTC | |
by Tanktalus (Canon) on Feb 04, 2005 at 17:07 UTC | |
|
Re: Filters within a filter...
by fauria (Deacon) on Feb 04, 2005 at 16:39 UTC |