Bret Hughes wrote:

> Please forgive the off topic post but I don't subscribe to a
> perl list, and hate to for the occasional 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
>     }
> }

Thanks for the tips guys.  As I was looking at my code, I
realied that I had not actually tried the combination that I
posted.  What i did try was:

@resarray= split /"\n"/, $resstring;

Which for some reason I can not discern, puts everything
(multiple lines) in the first element of the array.   If some
one would care to educate me on why that is I relly would like
to know. I thought the " allowed interpolation of the special
backslashed chars.

Thanks for the references.  This is my first attempt at using
modules and objects in perl.  Looks like there is more in my
future.

Bret



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

Reply via email to