multiple lines / success or failure?!
From: Geoff Cox (geoffacox_at_dontspamblueyonder.co.uk)
Date: 03/31/04
- Next message: John Bokma: "Re: multiple lines / success or failure?!"
- Previous message: Tassilo v. Parseval: "Re: Lost data on socket - Can we start over politely?"
- Next in thread: John Bokma: "Re: multiple lines / success or failure?!"
- Reply: John Bokma: "Re: multiple lines / success or failure?!"
- Reply: Sherm Pendley: "Re: multiple lines / success or failure?!"
- Reply: Tassilo v. Parseval: "Re: multiple lines / success or failure?!"
- Reply: Joe Smith: "Re: multiple lines / success or failure?!"
- Reply: ko: "Re: multiple lines / success or failure?!"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Wed, 31 Mar 2004 06:50:18 GMT
Hello
Re my previous posting on how to capture successive blocks of text
between <p> and </p> where the </p> is not on the first line of the
blocl of text in an html file ....
The only way that I have been able to extract the text and place it in
the correct place in the newly created file has been to edit all the
original html files so that the <p> and the </p> are on the same line,
ie instead of
<p>sjdhjhsjdhjhs
sjdjksjdkksj
jskdjkjs</p>
I have
<p>sjdhjhsjdhjhs sjdjksjdkksj jskdjkjs</p>
This is a failure on my part!
I have not tried HTML::Parser yet as I cannot find any help info to
get me started. All seen so far assume more than I know or understand
on OOP. I am back to where I was once on the use of ODBC when
eventually I found a little help and wrote my own steps 1 to 10 to
implement a simple example of this data base / CGI connectivity...
I am using Active Perl and Windows 98 and have tried to get the text
over multiple lines using
local $/ = "\0d\0a";
but the odd thing is that I have been ablle to get multiple lines of
text from a text version of an sql file with the default $/ value
using
sub intro {
my ($pathhere) = @_;
open (INN, "d:/keep/sqlfile.txt");
my $lineintro;
# my $lineintro = <INN>;
while (defined ($lineintro = <INN>)) {
if ($lineintro =~ /$pathhere','(.*?)'\)\;/) {
print OUT ("<tr><td>$1 <p> </td>\n");
}
}
}
and when I look at this sql text file using a hex editor I can see
that at the end of the block of text is 0D0A which is the same as the
<p> multiple lines </p> block in the html file but there I could not
get the text without breaking the rest of the Perl code...with or
without $/ = "\0d\0a";
Well, I could go on and on but I would like to use the HTML::Parser so
look forward to hearing about some intro type info with sample scripts
on its use! Or any Perl books which do this? Perhaps the latest Perl
O'Reilly books are OK?
Cheers
Geoff
- Next message: John Bokma: "Re: multiple lines / success or failure?!"
- Previous message: Tassilo v. Parseval: "Re: Lost data on socket - Can we start over politely?"
- Next in thread: John Bokma: "Re: multiple lines / success or failure?!"
- Reply: John Bokma: "Re: multiple lines / success or failure?!"
- Reply: Sherm Pendley: "Re: multiple lines / success or failure?!"
- Reply: Tassilo v. Parseval: "Re: multiple lines / success or failure?!"
- Reply: Joe Smith: "Re: multiple lines / success or failure?!"
- Reply: ko: "Re: multiple lines / success or failure?!"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|