[13987] in Perl-Users-Digest
Perl-Users Digest, Issue: 1397 Volume: 9
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Nov 16 14:12:20 1999
Date: Tue, 16 Nov 1999 11:10:22 -0800 (PST)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Message-Id: <942779421-v9-i1397@ruby.oce.orst.edu>
Content-Type: text
Perl-Users Digest Tue, 16 Nov 1999 Volume: 9 Number: 1397
Today's topics:
Perl Array close command on Windows <redrum@execpc.com>
Re: Perl Array close command on Windows <linberg@literacy.upenn.edu>
Perl Win32::NetAdmin::LocalGroupIsMember function julien_lauper@my-deja.com
Re: Problem with the sentence "use Win32::ODBC;" (Kragen Sitaker)
qn about Getopt::Long module geetago@my-deja.com
Re: Question... Carriage Returns in PERL <rootbeer@redcat.com>
Re: Question... Carriage Returns in PERL <lr@hpl.hp.com>
Re: Question... Carriage Returns in PERL <linberg@literacy.upenn.edu>
Re: reading html files <gellyfish@gellyfish.com>
Regular Expressions <panzer@hfeles.pt>
Re: Regular Expressions <lr@hpl.hp.com>
Re: Scheduling jobs .... working in windows but serveri (Kragen Sitaker)
Re: seeking seek algorithm (Bart Lateur)
Re: seeking seek algorithm (Kragen Sitaker)
Re: something like Text::Wrap::wrap() that's HTML aware (Jed Parsons)
Re: SQL Join with perl/DBI/DBD? (Kragen Sitaker)
Re: system() on Win 32 doesn't seem to do anything (Clinton Pierce)
Re: unbuffered input (Clinton Pierce)
Re: Using Open2() Win32 NT ? (Kragen Sitaker)
Re: Where can i find more information on Schwartzian tr <ah@datapharm.de>
Re: Why isn't the HTML::Parser an HTML::Parser? (Kragen Sitaker)
Re: Writing to binary files in Perl (Bart Lateur)
Re: Writing to binary files in Perl (Kragen Sitaker)
Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Tue, 16 Nov 1999 12:47:02 -0000
From: " Larsen" <redrum@execpc.com>
Subject: Perl Array close command on Windows
Message-Id: <3831a6f1$0$96888@news.execpc.com>
I'm just learning perl and I can't figure out the DOS command to close a
perl array when I'm running a script. ^Z and ^D don't work. Please help!!!
Thanks,
Larsen
------------------------------
Date: 16 Nov 1999 13:55:46 -0500
From: Steve Linberg <linberg@literacy.upenn.edu>
Subject: Re: Perl Array close command on Windows
Message-Id: <m3d7ta8dvx.fsf@projdirc.literacy.upenn.edu>
" Larsen" <redrum@execpc.com> writes:
> I'm just learning perl and I can't figure out the DOS command to close a
> perl array when I'm running a script. ^Z and ^D don't work. Please help!!!
Um, first we have to straighten out your terminology. An array is a data
construct. It isn't something that gets opened or closed. Are you trying
to figure out how to interrupt a running Perl script under DOS? Are you
trying to figure out how to end input from the keyboard?
--
Steve Linberg, Chief Goblin
Silicon Goblin Technologies
http://silicongoblin.com
Be kind. Remember, everyone you meet is fighting a hard battle.
------------------------------
Date: Tue, 16 Nov 1999 17:20:21 GMT
From: julien_lauper@my-deja.com
Subject: Perl Win32::NetAdmin::LocalGroupIsMember function
Message-Id: <80s3oe$8go$1@nnrp1.deja.com>
I am using the Win32::NetAdmin::LocalGroupIsMember Perl function to
test if a user is member of a local group.
However, this function does not answer true when the user is indirectly
member of the local group, ie when he belongs to a global group which
itself belong to the local group.
Is there any means to test this "indirect" membership?
The ifmember /l command from the resource kit does this!
Thanks.
Julien.
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Tue, 16 Nov 1999 18:04:45 GMT
From: kragen@dnaco.net (Kragen Sitaker)
Subject: Re: Problem with the sentence "use Win32::ODBC;"
Message-Id: <11hY3.18899$YI2.806028@typ11.nn.bcandid.com>
In article <0f2017c3.527d3bf2@usw-ex0106-044.remarq.com>,
Nancy <n.vincentNOn.SPAM@cross-systems.com.invalid> wrote:
>Can anyone tell me if he has already met such a problem, if there is a
>problem of configuration (of my navigator) or a problem in my script or
>anything else....
Sounds like either (a) your webserver is not configured to run it as a
script or (b) you don't have a web server. HTH.
--
<kragen@pobox.com> Kragen Sitaker <http://www.pobox.com/~kragen/>
The Internet stock bubble didn't burst on 1999-11-08. Hurrah!
<URL:http://www.pobox.com/~kragen/bubble.html>
------------------------------
Date: Tue, 16 Nov 1999 17:58:31 GMT
From: geetago@my-deja.com
Subject: qn about Getopt::Long module
Message-Id: <80s5vq$ad7$1@nnrp1.deja.com>
I am using Getopt::Long module for argument
parsing. How can i force my program to exit if
the it is invoked with an "unknown options"
Would appreciate your suggestions.
thanks
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Tue, 16 Nov 1999 10:05:59 -0800
From: Tom Phoenix <rootbeer@redcat.com>
Subject: Re: Question... Carriage Returns in PERL
Message-Id: <Pine.GSO.4.10.9911161003241.15797-100000@user2.teleport.com>
On 16 Nov 1999, Steve Linberg wrote:
> my $message_text = $q->param('form_control_name'); # or whatever
>
> $message_text =~ s/^\s+//gs; # strip leading whitespace including newlines
> $message_text =~ s/\s+$//gs; # strip trailing whitespace including newlinea
>
> complain_loudly('No text specified') unless $message_text;
Why does this complain loudly when I enter the single character '0' as the
message text? :-)
Maybe you want to check that $message_text is defined(). And, you'd want
to do that before using s/// on it. And what's with the /gs options? One
is misleading and the other is merely slowing your program.
Cheers!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Tue, 16 Nov 1999 10:39:40 -0800
From: Larry Rosler <lr@hpl.hp.com>
Subject: Re: Question... Carriage Returns in PERL
Message-Id: <MPG.129b44c75669b80098a213@nntp.hpl.hp.com>
In article <Pine.GSO.4.10.9911161003241.15797-100000@user2.teleport.com>
on Tue, 16 Nov 1999 10:05:59 -0800, Tom Phoenix <rootbeer@redcat.com>
says...
> On 16 Nov 1999, Steve Linberg wrote:
>
> > my $message_text = $q->param('form_control_name'); # or whatever
> >
> > $message_text =~ s/^\s+//gs; # strip leading whitespace including newlines
> > $message_text =~ s/\s+$//gs; # strip trailing whitespace including newlinea
> >
> > complain_loudly('No text specified') unless $message_text;
>
> Why does this complain loudly when I enter the single character '0' as the
> message text? :-)
>
> Maybe you want to check that $message_text is defined().
That's not the right test (especially because the variable has just been
used in two substitution operations, unhappily if it isn't defined).
complain_loudly('No text specified') unless length $message_text;
--
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: 16 Nov 1999 13:47:57 -0500
From: Steve Linberg <linberg@literacy.upenn.edu>
Subject: Re: Question... Carriage Returns in PERL
Message-Id: <m3g0y68e8y.fsf@projdirc.literacy.upenn.edu>
Tom Phoenix <rootbeer@redcat.com> writes:
> On 16 Nov 1999, Steve Linberg wrote:
>
> > my $message_text = $q->param('form_control_name'); # or whatever
> >
> > $message_text =~ s/^\s+//gs; # strip leading whitespace including newlines
> > $message_text =~ s/\s+$//gs; # strip trailing whitespace including newlinea
> >
> > complain_loudly('No text specified') unless $message_text;
>
> Why does this complain loudly when I enter the single character '0' as the
> message text? :-)
OK, OK. Sheesh, two sloppy dumb mistakes. I knew there was a reason I was
doing less posting here. :) All right, try and stop this one!
--------8<-----------
my $message_text = $q->param('form_control_name'); # or whatever
$message_text =~ s/^\s+//;
$message_text =~ s/\s+$//;
complain_loudly('No text specified') unless length($message_text);
------->8-------------
> Maybe you want to check that $message_text is defined(). And, you'd want
> to do that before using s/// on it.
Can you clarify the second statement? Is that from a perspective of
aesthetics, or efficiency? Putting an empty string through a regex is
pretty fast, right? From my own aesthetic perspective, it's better than
checking $message_text twice, once before and again after the s///.
Actually, you could of course do this, which sidesteps the issue and is
perhaps a better solution:
--------8<-----------
complain_loudly('it don't look good') unless
((my $message_text = $q->param('form_control_name')) =~ /\S/);
-------->8-----------
--
Steve Linberg, Chief Goblin
Silicon Goblin Technologies
http://silicongoblin.com
Be kind. Remember, everyone you meet is fighting a hard battle.
------------------------------
Date: 16 Nov 1999 17:10:12 GMT
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: reading html files
Message-Id: <38318ff4_1@newsread3.dircon.co.uk>
Michael Budash <mbudash@wcws.com> wrote:
> In article <38317a1a.0@news.netdirect.net.uk>, "Nigell Boulton"
> <nigell.boulton@rade.net> wrote:
>
>> I am developing a system to read HTML files from a news feed web site and
>> place it code within my template.
>>
>> How can I read a html file as code and import it into my code?
>>
>> regards
>> Nigell
>
> IIUYQ, try LWP (available at CPAN)
>
He might also want to use HTML::Parser to extract the relevant bits of
the page but as he isnt more forthcoming about what he is trying to do
I dont think I'll worry about an example ...
/J\
--
"As usual I'm the price you have to pay for the funny bits" - Denis Norden
------------------------------
Date: Tue, 16 Nov 1999 18:06:23 -0000
From: "Luis Figueiredo" <panzer@hfeles.pt>
Subject: Regular Expressions
Message-Id: <80s6in$rhp$1@duke.telepac.pt>
Hi,
I'm kinda new to Perl, and i'm writing a little program to parse a text
file.
Anyway i have run in to trouble with one regular expression matching.
I need to find at least two ; (semi-colons) in a string to execute a block
of code.
The ; are scattered all over the string, spliting the keyword of that
particular text.
I need this match, to be able to differentiate the keywords, from
semi-colons in the middle of the text.
The structure of the file is like this:
title
keyword: blah;blah;blah;blah;blah;
Text
Text
......
Text
Text
======
The code i'm using is like this:
$x="any;text;split;with;semi-colons;";
if ($x =~ /;{2, }/) {print "yes";};
i tryed on using
if ($x =~ /\;{2, }/) {print "yes";};
Hoping that the semicolon was causing the problem, but with no results.
I'm using the number 2 as an example, 3 or 4 would be more apropriated.
I've searched all over the web, and could fix the problem.
If anyone could help, please do!
I'm going a bit confused about regex. :-)
Thanks in advance
--
Luis Figueiredo
------------------------------
Date: Tue, 16 Nov 1999 10:45:51 -0800
From: Larry Rosler <lr@hpl.hp.com>
Subject: Re: Regular Expressions
Message-Id: <MPG.129b4636e6668ef598a214@nntp.hpl.hp.com>
In article <80s6in$rhp$1@duke.telepac.pt> on Tue, 16 Nov 1999 18:06:23 -
0000, Luis Figueiredo <panzer@hfeles.pt> says...
...
> I need to find at least two ; (semi-colons) in a string to execute a block
> of code.
> The ; are scattered all over the string, spliting the keyword of that
> particular text.
perlfaq4: "How can I count the number of occurrences of a substring
within a string?"
> I've searched all over the web, and could fix the problem.
"could" => "couldn't"?
Like the Bluebird of Happiness, the FAQs and all the Perl docs are in
your own backyard (if that's where your hard disk is :-).
--
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: Tue, 16 Nov 1999 17:53:29 GMT
From: kragen@dnaco.net (Kragen Sitaker)
Subject: Re: Scheduling jobs .... working in windows but serveris linux
Message-Id: <tSgY3.18860$YI2.804670@typ11.nn.bcandid.com>
In article <80rufc$8e2$1@news.vsnl.net.in>,
Ishpal <ishpal@infobase.co.in> wrote:
>I need to schedule jobs .. like sending e-mails at regular intervals say
>everyweek. How can I shedulemy script to run at regular intervals.
>I'm working in windows NT but the server on which our site is hoated is a
>Linux server.
cron. Not a Perl question.
--
<kragen@pobox.com> Kragen Sitaker <http://www.pobox.com/~kragen/>
The Internet stock bubble didn't burst on 1999-11-08. Hurrah!
<URL:http://www.pobox.com/~kragen/bubble.html>
------------------------------
Date: Tue, 16 Nov 1999 17:16:30 GMT
From: bart.lateur@skynet.be (Bart Lateur)
Subject: Re: seeking seek algorithm
Message-Id: <38339084.2968806@news.skynet.be>
paul_p_francis@my-deja.com wrote:
>i have a large (over 20 Gig) binary file with fixed length records. i
>have to aggregate 2 fields and calculate frequency distribution on
>another field. the problem is it takes over 65 minutes for my perl
>script to complete on a unix server running perl 5.005.
>
>if possible, i am hoping to find a way to speed this up.
>
>currently i am trying to use threads and seek() to start at 4
>different places (tot_recs/4)in the file and work forward until overlap-
>1 with no luck so far.
I can't see how this would help. You're subdividing the processor power,
which would go almost entirely to this one task, over 4 virtually
identical tasks, which all need to do one quarter of the lot, but only
having one quarter of the CPUI power available. Therefore, it will
probably take about just as long, within a few percent; probably it will
be slower (overhead of the process juggling).
--
Bart.
------------------------------
Date: Tue, 16 Nov 1999 17:51:11 GMT
From: kragen@dnaco.net (Kragen Sitaker)
Subject: Re: seeking seek algorithm
Message-Id: <jQgY3.18856$YI2.801688@typ11.nn.bcandid.com>
In article <80qpfg$9rt$1@nnrp1.deja.com>, <paul_p_francis@my-deja.com> wrote:
>i have a large (over 20 Gig) binary file with fixed length records. i
>have to aggregate 2 fields and calculate frequency distribution on
>another field. the problem is it takes over 65 minutes for my perl
>script to complete on a unix server running perl 5.005.
What's the bottleneck on your system? Is it the disk speed, the CPU
speed, or what? 20 gig over 65 minutes is
20*1024/(65*60) =
5.25128205128205128205 megabytes per second. If you have a relatively
slow disk, this might be the bottleneck.
You can test it; just read in the whole file and don't bother to do
anything on it. One-megabyte chunks should be sufficient to make the
CPU overhead disappear.
Also, you can run 'top' while you're running your current script to see
what the CPU usage is. If it's 30%, it probably means your CPU is not
the bottleneck. If it's 100% (including system time and other
processes --- i.e. 0% idle) then the CPU is the bottleneck.
If the CPU is not the bottleneck, consider getting a RAID, or just a
faster disk.
>if possible, i am hoping to find a way to speed this up.
>
>currently i am trying to use threads and seek() to start at 4
>different places (tot_recs/4)in the file and work forward until overlap-
>1 with no luck so far.
This may work if (a) you have multiple CPUs and (b) the CPU is the
bottleneck. Some advice in this case:
- use multiple processes, not threads, if you can help it; they're easier.
- test to see if it speeds things up.
What's the "no luck" part, btw? Are you having trouble seek()ing in a
large file?
>if anyone has a better approach or a related example, i would really
>appreciate it.
Is it possible to do this incrementally? For example, if your file is
20Gig, but the only way it changes is that 100MB gets added at the end
every day, you could perhaps win by scanning only that 100MB and
updating your stats. If it's updated in the middle, perhaps you could
get the updated record numbers logged somewhere, along with their
previous contents.
--
<kragen@pobox.com> Kragen Sitaker <http://www.pobox.com/~kragen/>
The Internet stock bubble didn't burst on 1999-11-08. Hurrah!
<URL:http://www.pobox.com/~kragen/bubble.html>
------------------------------
Date: 16 Nov 1999 18:34:57 GMT
From: jed@socrates.berkeley.edu (Jed Parsons)
Subject: Re: something like Text::Wrap::wrap() that's HTML aware?
Message-Id: <80s84h$m6e$1@agate.berkeley.edu>
Maybe I shouldn't be using Text::Wrap in the first place. What I want to
do is present chunks of text with line numbers on a web page. I want
every viewer of the page to see the same text/line number correspondence.
The only solution I can think of is to make a table consisting of two
columns, one for lines of the text, the other for line numbers (every
fifth).
There are two immmediate problems. First, HTML code must be overlooked in
calculating the length of a line in determining where to chop it off
(where to wrap). The second problem is that unclosed HTML tags must be
closed and reopened on the next line. For example, leaving out any HTML
table code for clarity, I might want this text ...
Fighting crime, trying to save the world, here they come <I>just in
time</I>, the Powerpuff Girls!
... to come out like this ...
Fighting crime,
trying to save
the world, here
they come <I>just</I>
<I>in time</I>, the 5
Powerpuff Girls!
Where the <I> element was broken over two rows in the table. (Of course,
adding to the confusion, there may be multiple open tags at any given
time.)
Any suggestions?
Thanks,
Jed
--
Jed Parsons mailto:jed@socrates.berkeley.edu
http://socrates.berkeley.edu/~jed/
"Okay! You know, super ideas do not grow on trees!" --- Supergrover
------------------------------
Date: Tue, 16 Nov 1999 17:07:21 GMT
From: kragen@dnaco.net (Kragen Sitaker)
Subject: Re: SQL Join with perl/DBI/DBD?
Message-Id: <dbgY3.18614$YI2.799418@typ11.nn.bcandid.com>
In article <80q14p$oi6$1@nnrp1.deja.com>, <jkort@wimberley-tx.com> wrote:
>Been reading a lot on the use of perl/DBI/DBD to access different
>databases. I see how you can have multiple connections to different
>data sources simultaneously, but is there any way to do an SQL join
>between those different data sources in a single query? Or can you only
>extract data from each source separately into a perl variable, and then
>try to join the data together under perl? If the join must be done
>with perl code, not within the sql, how would I do it?
Wouldn't It Be Awesome If Someone[0] . . .
wrote an SQL frontend to SQL databases? You'd feed it SQL
statements that referred to data from all the different
databases, and it would figure out what SQL statements it had
to send to each database -- and what it had to do internally --
to carry out your bidding. It'd have to have a lot of
query-optimization smarts, but it wouldn't have to deal with
the whole query-evaluation thing. And it would have less
information to optimize with than its backend databases.
To get proper transactional semantics, it would need to do a
two-phase commit thing at least. Do you suppose the SQL COMMIT
statement can fail? Someone Should Find Out[1].
[0], [1] -- these are capitalized to indicate that I am aware that they
sound silly. I don't actually expect Someone to do them -- I expect
I'd have to do them myself, which means they'll probably never happen.
And I'm aware they're a bit naive. But I hope you enjoyed the post
nevertheless :)
--
<kragen@pobox.com> Kragen Sitaker <http://www.pobox.com/~kragen/>
The Internet stock bubble didn't burst on 1999-11-08. Hurrah!
<URL:http://www.pobox.com/~kragen/bubble.html>
------------------------------
Date: Tue, 16 Nov 1999 16:24:46 GMT
From: cpierce1@ford.com (Clinton Pierce)
Subject: Re: system() on Win 32 doesn't seem to do anything
Message-Id: <38328235.298033719@news.ford.com>
[poster cc'd in e-mail]
On Tue, 16 Nov 1999 10:21:23 -0500, "Jodi Kerper" <jkerper@edgil.com>
wrote:
>The script fragment looks something like this:
>----------------------------------------------------------------------------
>-----------
> $cmd = 'dbbackup -c "dsn='.$file.';uid=DBA;pwd='.$pwd.'" ' ;
> $cmd = $cmd.'-y -x -o'.$dev.'\\backup\\'.$day.'.txt ' ;
> $cmd = $cmd.$dev.'\\backup' ;
Jeez that's ugly. Try this for a little more readable style:
$cmd = qq{dbbackup -c "dsn=$file;uid=DBA;pwd=$pwd" -y -x
-o$dev\\backup\\$day.txt $dev\\backup};
I think I got all the spaces in the right place. There's an extra newline
after the -x, just for posting here though.
Also, if you've got a lot of concatenation (".") going on, you can say:
$cmd.="Foo";
Instead. It's a little better looking, IMHO.
>I only see the command I've built up ($cmd) printed out to the console.
>dbbackup doesn't execute.
Nothing wrong with system() afaik, except that NT isn't really set up for
multiprocessing and it's shell is hopelessly broken. :)
--
Clinton A. Pierce "If you rush a Miracle Man, you
clintp@geeksalad.org get rotten Miracles." -- Miracle Max,
http://www.geeksalad.org The Princess Bride
------------------------------
Date: Tue, 16 Nov 1999 16:45:12 GMT
From: cpierce1@ford.com (Clinton Pierce)
Subject: Re: unbuffered input
Message-Id: <383387ef.299499046@news.ford.com>
[poster cc'd in e-mail]
On Tue, 16 Nov 1999 16:12:16 +0100, Håkan Jonsson
<hakjo733@student.liu.se> wrote:
>I am trying to make a loop, which is automatically exited if the user
>presses any key on the keyboard. Meanwhile, the loop is suppoused to be
>running. Therefore, the input must be unbuffered, and the program must
>proceed without waiting for any input.
That's an FAQ. Didn't you even try looking for this before you asked?
Perl FAQ #5, "How can I read a single character from a file?
From the keyboard?"
Shoo. Begone.
--
Clinton A. Pierce "If you rush a Miracle Man, you
clintp@geeksalad.org get rotten Miracles." -- Miracle Max,
http://www.geeksalad.org The Princess Bride
------------------------------
Date: Tue, 16 Nov 1999 17:30:18 GMT
From: kragen@dnaco.net (Kragen Sitaker)
Subject: Re: Using Open2() Win32 NT ?
Message-Id: <KwgY3.18824$YI2.801742@typ11.nn.bcandid.com>
In article <3831682F.891EDEA@cpkwebser5.ncr.disa.mil>,
Steven T. Hatton <hattons@cpkwebser5.ncr.disa.mil> wrote:
>Get $variable
>Stream $Variable into | commandLine.exe | read $results from pipe.
#!/usr/bin/perl -w
use strict;
my $variable = "blah badoo maga " x 100;
open TMPOUT, ">foo" or die "Can't open foo: $!\n";
print TMPOUT $variable;
close TMPOUT;
open RESULTS, "fmt < foo |" or die "Can't fork: $!\n";
while (<RESULTS>) {
print "got: $_";
}
unlink "foo" or die "Can't unlink foo: $!\n";
You might want to pick a different filename, of course, and fmt only
exists in Unix. But this should clarify the technique.
--
<kragen@pobox.com> Kragen Sitaker <http://www.pobox.com/~kragen/>
The Internet stock bubble didn't burst on 1999-11-08. Hurrah!
<URL:http://www.pobox.com/~kragen/bubble.html>
------------------------------
Date: Tue, 16 Nov 1999 19:05:03 -0800
From: Andreas Huber <ah@datapharm.de>
Subject: Re: Where can i find more information on Schwartzian transform!
Message-Id: <38321B5E.5675C56@datapharm.de>
try this: http://www.5sigma.com/perl/schwtr.html
Benjamin Gu wrote:
>
> Dear all, would like to show me
> where i can find more information on
> Schwartzian transform?
>
> Regards
>
> Benjamin
--
Andreas Huber
Datapharm Netsystems AG
E-Mail: ah@datapharm.de
Tel.: +49 89 85 68 -4156
Fax: +49 89 85 68 -4100
------------------------------
Date: Tue, 16 Nov 1999 17:59:59 GMT
From: kragen@dnaco.net (Kragen Sitaker)
Subject: Re: Why isn't the HTML::Parser an HTML::Parser?
Message-Id: <zYgY3.18880$YI2.805286@typ11.nn.bcandid.com>
In article <80rkmn$5es$1@nntp9.atl.mindspring.net>,
Eric Bohlman <ebohlman@netcom.com> wrote:
>Alexander Lazic (A.Lazic@Austria.EU.net) wrote:
>: in some article i have read that, but i don't anderstand it because i
>: use it and i haven't any problems.
>
>A true HTML parser needs to cope with various SGML constructs (e.g.
>entity definitions, marked sections) that can in principle occur in any
>SGML application. These constructs are in fact seldom found in HTML
>documents because most user agents can't process them either, so *that*
>shortcoming is seldom a problem.
Some people think HTML is an application of SGML. But what most people
and software -- including Netscape Navigator and MSIE -- call HTML is a
separate language altogether. And it is a regular language.
>element has an explicit end-tag. This means that you need to use
>application logic to figure out where certain elements end, and if you
>get it wrong, your application will stumble over perfectly legal constructs.
>
>A true HTML parser uses an HTML DTD to guide its parsing. HTML::Parser
>is really only a tokenizer. For many applications that's all you really
>need, but the name *is* misleading.
If you parse HTML as if it were an application of SGML, your
application will stumble over illegal constructs that are widely used.
--
<kragen@pobox.com> Kragen Sitaker <http://www.pobox.com/~kragen/>
The Internet stock bubble didn't burst on 1999-11-08. Hurrah!
<URL:http://www.pobox.com/~kragen/bubble.html>
------------------------------
Date: Tue, 16 Nov 1999 17:09:12 GMT
From: bart.lateur@skynet.be (Bart Lateur)
Subject: Re: Writing to binary files in Perl
Message-Id: <38328f47.2652493@news.skynet.be>
vsam1 wrote:
>I am sorry. Last time I checked there were no answers to my previous
>question and it was on the third or 4th page by then. So I figured
>people wouldn't bother scrolling to my question.
Not everybody uses that same crappy "newsreader". Most here don't.
Mine, for example, only shows threads to which new posts have been added
since last time I checked, which could be yesterday, or just two minutes
ago.
--
Bart.
------------------------------
Date: Tue, 16 Nov 1999 17:19:15 GMT
From: kragen@dnaco.net (Kragen Sitaker)
Subject: Re: Writing to binary files in Perl
Message-Id: <nmgY3.18703$YI2.800749@typ11.nn.bcandid.com>
In article <1415c574.f4fb18b0@usw-ex0107-043.remarq.com>,
vsam1 <gte017gNOgtSPAM@prism.gatech.edu.invalid> wrote:
>I am sorry. Last time I checked there were no answers to my previous
>question and it was on the third or 4th page by then. So I figured
>people wouldn't bother scrolling to my question.
Your question isn't on a page. You posted it to Usenet. You did not
post it on the Web. The only time I scroll things on Usenet is when
I'm reading an article that's longer than a screenful; then I scroll
the text in the article.
--
<kragen@pobox.com> Kragen Sitaker <http://www.pobox.com/~kragen/>
The Internet stock bubble didn't burst on 1999-11-08. Hurrah!
<URL:http://www.pobox.com/~kragen/bubble.html>
------------------------------
Date: 16 Sep 99 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 16 Sep 99)
Message-Id: <null>
Administrivia:
The Perl-Users Digest is a retransmission of the USENET newsgroup
comp.lang.perl.misc. For subscription or unsubscription requests, send
the single line:
subscribe perl-users
or:
unsubscribe perl-users
to almanac@ruby.oce.orst.edu.
| NOTE: The mail to news gateway, and thus the ability to submit articles
| through this service to the newsgroup, has been removed. I do not have
| time to individually vet each article to make sure that someone isn't
| abusing the service, and I no longer have any desire to waste my time
| dealing with the campus admins when some fool complains to them about an
| article that has come through the gateway instead of complaining
| to the source.
To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.
To request back copies (available for a week or so), send your request
to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
where x is the volume number and y is the issue number.
For other requests pertaining to the digest, send mail to
perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
sending perl questions to the -request address, I don't have time to
answer them even if I did know the answer.
------------------------------
End of Perl-Users Digest V9 Issue 1397
**************************************