I don't intend to be rude, but your post sounds to me like someone walking into someones home and exclaiming "Geez! What an ugly sofa! You should buy a new one!" All the while, you're wearing a burnt-orange shirt and a lime-green suit with purple socks.
I personally don't want all the glitter and beads on a website. I just want something that works well. And things are pretty nice, here, thanks.
Anyway, if each file contains one chunk of text you want, then I'd do something similar to:
use strict; use warnings; open OUF, '>', 'CollectedInfo.txt' or die; while (my $FName = shift) { print OUF doit($FName), "\n\n"; } close OUF; sub doit { my $text; if (! open INF, '<', $_[0]) { print "Can't open file '$_[0]', skipped!\n"; return ''; } # slurp in the entire file local $/; $text = <INF>; # Trim off everything before "Hit # of #" $text =~ s/^.*?Hit\s+\d+of\s\d+//; # Trim off everything after "listed since:" $text =~ s/listed since:.*$//; # Code for cleaning up the text goes here # (left as exercise for the reader) # Return desired chunk of text return $text; }
Note: untested, you can keep both pieces if (when) it breaks, etc.
...roboticus
In reply to OT: What a hideous sofa! (Re: Parsing with HTML::TreeBuilder::LibXML...)
by roboticus
in thread Parsing with HTML::TreeBuilder::LibXML on OpenSuse Linux 11.4 Milestone 1
by Perlbeginner1
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |