I send you (privately) a sample to look through, if that doesn't 
work, (and this may help others with some things too)  there is a place 
called All Experts at http://www.allexperts.com  where you can ask people 
questions for free.  I used to volunteer there when I had more time.  They 
have everything from accounting to Web Programming (and just about 
everything in between).  It's a great resource!

         Fred

At 04:10 AM 9/6/00 -0700, you wrote:

> > Please forgive the off topic post but I don't subscribe to a
> > perl list, and hate to for the occasional question.
>
>Don't neglect the usenet newsgroups.  There's always
>comp.lang.perl.misc, or possibly comp.infosystems.www.misc
>(or you might even try comp.infosystems.www.authoring.cgi,
>which has more traffic, though this isn't technically a cgi
>question).
>
> > OK, I give up.  I know this should be a simple task but I
> > cannot get it to work.  I am using the perl libwww request
> > object to retrieve the results of a POST. I get the result
> > back (html page source) in one big string.  How do I parse
> > the string variable into an array with each element
> > containing one line of the result.
> >
> > I figured I sould do something like :
> > $resstring = $ua->request($req)->as_string;
> >
> > @resarray= split /\n/, $resstring;
> > for (@resarray) {
> >     if (/string/) {
> >         further processing
> >     }
> > }
>
>I'm not familiar with the libwww module, but there isn't
>anything wrong with doing this:
>
>    @resarray= split /\n/, $resstring;
>
>So the problem must be that the returned string simply
>doesn't have any newlines in it.  Remember, newlines aren't
>required in HTML: human beings tend to stick them in for
>readability, but machine generated code tends to skip them
>for the sake of speed (why transmit a character that doesn't
>do anything?).
>
>So you're going to have to chunk this material in a
>different way.  For example, something like this *might*
>work to find end tags, and use those as line terminators:
>
>while ( $resstring =~ m|(.*?)</(.*?)>|g ) {
>   $chunk =  "$1</$2>";
>   push @resarray, $chunk;
>
>}
>
>But if you're serious about this stuff, I'd recommend
>looking at the O'Reilly book "Web Client Programming" by
>Clinton Wong.  He talks about the LWP and HTML perl modules,
>and presents lots of example code.  E.g. on page 90, there's
>a 10 line script that can extract all the URLs used on a
>given web page...
>
>
>
>
>
>
>_______________________________________________
>Redhat-list mailing list
>[EMAIL PROTECTED]
>https://listman.redhat.com/mailman/listinfo/redhat-list



_______________________________________________
Redhat-list mailing list
[EMAIL PROTECTED]
https://listman.redhat.com/mailman/listinfo/redhat-list

Reply via email to