Perlbeginner1:

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

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.