[26080] in Perl-Users-Digest
Perl-Users Digest, Issue: 8281 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Jul 27 09:05:32 2005
Date: Wed, 27 Jul 2005 06:05:08 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Perl-Users Digest Wed, 27 Jul 2005 Volume: 10 Number: 8281
Today's topics:
Re: Active State Perl <see.sig@rochester.rr.com>
Re: Active State Perl jane@rifill.com
Re: Active State Perl <zawrotny@sb.fsu.edu>
Re: baking cookies <djames@thehub.com.au>
Re: How does a scalar know what it is? <lfs.1@spam.net>
Re: How does a scalar know what it is? <tassilo.von.parseval@rwth-aachen.de>
Re: How does a scalar know what it is? <sisyphus1@nomail.afraid.org>
Re: kill 0 <vek@station02.ohout.pharmapartners.nl>
Re: Linux distribs lacking perldoc <djames@thehub.com.au>
Re: Numeric or character ? (Anno Siegel)
Re: Numeric or character ? <sven-thorsten.fahrbach@gmx.net>
Re: Numeric or character ? (Anno Siegel)
Re: OT: Social responsibility when writing HTML <spam-block-@-SEE-MY-SIG.com>
Re: OT: Social responsibility when writing HTML <spam-block-@-SEE-MY-SIG.com>
Perl performance issue <"See signature for e-mail address:;">
Wget-like for Perl <penguin_x@phreaker.net>
Re: Wget-like for Perl <josef.moellers@fujitsu-siemens.com>
Re: Wget-like for Perl <penguin_x@phreaker.net>
XML::Parser - trapping badly formed XML ? <andygillanders@xxnospamxx.charter.net>
Re: XML::Parser - trapping badly formed XML ? <kevin@vaildc.net>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Tue, 26 Jul 2005 23:12:12 GMT
From: Bob Walton <see.sig@rochester.rr.com>
Subject: Re: Active State Perl
Message-Id: <grzFe.69760$0i3.56049@twister.nyroc.rr.com>
jane@rifill.com wrote:
...
> I have been advised that I want Active State Perl
>
> http://www.activestate.com/Products/ActivePerl/?psbx=1
>
> to run on my WinXp Pro computer With Apache2
>
> I have been to the Active state Perl site and I'm more confused to what I want for WinXp
> Pro.
> I think this is the one
> ActivePerl-5.8.7.813-MSWin32-x86-148120.msi
That one should do fine.
>
> Also I was informed that I wanted imagemagick also inside this is a PerlMagick
>
> http://studio.imagemagick.org/script/binary-releases.php#windows
>
> BUT which one do I need for my system
Assuming you want to use Image::Magick from Perl, you should use
ppm (Perl Package Manager) to install the Image::Magick module
once you have ActiveState Perl installed. Just issue:
ppm
at a command prompt and then type
install image-magick
The executables on the imagemagick web site will install
standalone Imagemagick. If that is what you want, fine.
Caveat: Although I have Image::Magick installed, I'm not an
Imagemagick user.
...
> Jane
--
Bob Walton
Email: http://bwalton.com/cgi-bin/emailbob.pl
------------------------------
Date: Wed, 27 Jul 2005 09:16:50 GMT
From: jane@rifill.com
Subject: Re: Active State Perl
Message-Id: <lkjee15f8ke9a9nkvudv60adjgijel7pl7@4ax.com>
Hi Bob
Thank you so much for getting back to me with the info
Please below comments
On Tue, 26 Jul 2005 23:12:12 GMT, Bob Walton <see.sig@rochester.rr.com> wrote:
>jane@rifill.com wrote:
>
>...
>> I have been advised that I want Active State Perl
>>
>> http://www.activestate.com/Products/ActivePerl/?psbx=1
>>
>> to run on my WinXp Pro computer With Apache2
>>
>> I have been to the Active state Perl site and I'm more confused to what I want for WinXp
>> Pro.
>> I think this is the one
>> ActivePerl-5.8.7.813-MSWin32-x86-148120.msi
>
>That one should do fine.
Ok all installed fine and tested out ok
###################
>>
>> Also I was informed that I wanted imagemagick also inside this is a PerlMagick
>>
>> http://studio.imagemagick.org/script/binary-releases.php#windows
>>
>> BUT which one do I need for my system
>
>Assuming you want to use Image::Magick from Perl, you should use
>ppm (Perl Package Manager) to install the Image::Magick module
>once you have ActiveState Perl installed. Just issue:
>
> ppm
>
>at a command prompt and then type
I have a problem with the above like
Cmd
ppm
Does nothing just brings me back to the c: root
BUT if I type ppm3.bat then it brings me to the ppm prompt
Is that the same as ppm?
#########################
Thank you for your help
Jane
>
> install image-magick
>
>The executables on the imagemagick web site will install
>standalone Imagemagick. If that is what you want, fine.
>
>Caveat: Although I have Image::Magick installed, I'm not an
>Imagemagick user.
>...
>> Jane
------------------------------
Date: 27 Jul 2005 12:43:15 GMT
From: Michael Zawrotny <zawrotny@sb.fsu.edu>
Subject: Re: Active State Perl
Message-Id: <slrndef0dn.91v.zawrotny@localhost.localdomain>
On Tue, 26 Jul 2005 23:12:12 GMT, Bob Walton <see.sig@rochester.rr.com> wrote:
>
> The executables on the imagemagick web site will install
> standalone Imagemagick. If that is what you want, fine.
When I installed them a couple of months ago, there was an option to
install the module in addition to the standalone utilities. It
worked, but for some strange reason, I had to run through the
installer twice to be able to use the module.
Mike
--
Michael Zawrotny
Institute of Molecular Biophysics
Florida State University | email: zawrotny@sb.fsu.edu
Tallahassee, FL 32306-4380 | phone: (850) 644-0069
------------------------------
Date: Wed, 27 Jul 2005 11:58:44 +1000
From: Damian James <djames@thehub.com.au>
Subject: Re: baking cookies
Message-Id: <slrndedqik.36t.djames@stumble.qimr.edu.au>
On Tue, 26 Jul 2005 15:47:56 GMT, Dean A. Hoover said:
> In CGI.pm there is a function for making a cookie
> from a scalar, hash, or array. It apparentley does
> not support lists of lists, hashes of lists, etc.
> Is there existing code that will do that?
Look at Data::Dumper.
--Damian
------------------------------
Date: Tue, 26 Jul 2005 22:50:46 -0500
From: "Tom" <lfs.1@spam.net>
Subject: Re: How does a scalar know what it is?
Message-Id: <bpednXYY1fzsmXrfRVn-vQ@comcast.com>
"Sisyphus" <sisyphus1@nomail.afraid.org> wrote in message
news:42e463b2$0$27469$afc38c87@news.optusnet.com.au...
>
> "Tom" <lfs.1@spam.net> wrote
>
> >
> > It looks to me that these scalars are carrying around
> > alot of baggage. Does it need to carry this baggage
> > on the function calls?
> >
>
> Think of it as the scalars carrying around a pointer to the baggage
(rather
> than carrying around the actual baggage) - which is not such a big load to
> be carrying.
>
> Cheers,
> Rob
>
>
But that isnt true.
------------------------------
Date: Wed, 27 Jul 2005 07:06:36 +0200
From: "Tassilo v. Parseval" <tassilo.von.parseval@rwth-aachen.de>
Subject: Re: How does a scalar know what it is?
Message-Id: <slrndee5is.ro.tassilo.von.parseval@localhost.localdomain>
Also sprach Tom:
> "Sisyphus" <sisyphus1@nomail.afraid.org> wrote in message
> news:42e463b2$0$27469$afc38c87@news.optusnet.com.au...
>>
>> "Tom" <lfs.1@spam.net> wrote
>>
>> >
>> > It looks to me that these scalars are carrying around
>> > alot of baggage. Does it need to carry this baggage
>> > on the function calls?
>> >
>>
>> Think of it as the scalars carrying around a pointer to the baggage
>> (rather than carrying around the actual baggage) - which is not such
>> a big load to be carrying.
> But that isnt true.
Oh, it isn't? Then maybe you explain us how the innards of perl work. I
am sure you know much better than those people who have worked with perl
on the C-level.
Tassilo
--
use bigint;
$n=71423350343770280161397026330337371139054411854220053437565440;
$m=-8,;;$_=$n&(0xff)<<$m,,$_>>=$m,,print+chr,,while(($m+=8)<=200);
------------------------------
Date: Wed, 27 Jul 2005 20:14:23 +1000
From: "Sisyphus" <sisyphus1@nomail.afraid.org>
Subject: Re: How does a scalar know what it is?
Message-Id: <42e75eb0$0$27469$afc38c87@news.optusnet.com.au>
"Tom" <lfs.1@spam.net> wrote in message
news:bpednXYY1fzsmXrfRVn-vQ@comcast.com...
>
> "Sisyphus" <sisyphus1@nomail.afraid.org> wrote in message
> news:42e463b2$0$27469$afc38c87@news.optusnet.com.au...
> >
> > "Tom" <lfs.1@spam.net> wrote
> >
> > >
> > > It looks to me that these scalars are carrying around
> > > alot of baggage. Does it need to carry this baggage
> > > on the function calls?
> > >
> >
> > Think of it as the scalars carrying around a pointer to the baggage
> (rather
> > than carrying around the actual baggage) - which is not such a big load
to
> > be carrying.
> >
> > Cheers,
> > Rob
> >
> >
>
> But that isnt true.
>
>
I'm not the best person to be giving an explanation at this level but I
think I understand where your confusion arises. I often see written
something like "a scalar (such as $x) is represented in Perl as a C
structure of type SV". (This statement equates a perl scalar to an SV.) I
would prefer to see it written as "a scalar (such as $x) is represented in
Perl as a pointer to a C structure of type SV". (This statement equates a
perl scalar to an SV*.)
When you pass a scalar to a function at the perl level, what's actually
happening at the C level ? You're passing a pointer to an SV structure to
the function.
Do you have a C compiler ? If you do, then here's a little Inline::C demo
you could run:
use warnings;
use Devel::Peek;
use Inline C => <<'EOC';
void foo(SV * x) {
printf("%x\n", x);
}
EOC
# Start perl code
$z = 17;
Dump($z);
print"#########\n";
foo($z);
__END__
For me that produces:
SV = IV(0x89dab4) at 0x3f5d3c
REFCNT = 1
FLAGS = (IOK,pIOK)
IV = 17
#########
3f5d3c
Note that at the C level, foo() receives an argument of type SV* - ie a
pointer to an SV structure.
And at the perl level foo() takes a simple scalar as its argument - ie $z.
Note also that the value output by foo() matches the address of the SV
structure. That's not a coincidence :-)
So ... when I'm calling foo($z), the baggage is staying put. All I'm really
passing is a pointer to all of that baggage.
In a similar fashion, we can create a perl scalar at the C level.
use warnings;
use Devel::Peek;
use Inline C => <<'EOC';
SV * foo() {
SV * x;
x = newSViv(17);
return x;
}
EOC
$z = foo();
Dump($z);
__END__
That produces output of:
SV = IV(0xb492e8) at 0x3f5d3c
REFCNT = 1
FLAGS = (IOK,pIOK)
IV = 17
At the C level, an SV structure has been created, and a pointer to that
structure (an SV*) has been returned. Yet as far as perl is concerned, the
foo() function has returned a scalar variable.
Hth. (More importantly, I hope it's accurate. If not, I'm sure that someone
will correct it as needed.)
Cheers,
Rob
------------------------------
Date: 27 Jul 2005 07:17:28 GMT
From: Villy Kruse <vek@station02.ohout.pharmapartners.nl>
Subject: Re: kill 0
Message-Id: <slrndeed88.212.vek@station02.ohout.pharmapartners.nl>
On Tue, 26 Jul 2005 15:17:03 +0000 (UTC),
Brandon Metcalf <bmetcalf@nortel.com> wrote:
> I'm seeing a behavior with using "kill 0,$pid" to determine if a
> process is running that I didn't expect. It seems that only root can
> correctly get the status on processes that root or another user that
> is different from the one calling kill() owns. For example,
>
On unix you have three posibilities when using kill(0, pid).
- kill returns 0 The program is running.
- kill returns -1 and errno = EPERM The program is running.
- kill returns -1 and errno = ESRCH The program is not running.
In your case you probably encountered the second posibility.
Villy
------------------------------
Date: Wed, 27 Jul 2005 11:55:57 +1000
From: Damian James <djames@thehub.com.au>
Subject: Re: Linux distribs lacking perldoc
Message-Id: <slrndedqdd.36t.djames@stumble.qimr.edu.au>
On Tue, 26 Jul 2005 12:10:09 GMT, axel@white-eagle.invalid.uk said:
> ...
> I like the look of BSD in general but have not had much chance to
> use it (except for the variant shipped with MAC OS X). It reminds
> me very much of SunOS before Solaris.
SunOS before Solaris *was* BSD.
> ...
> Actually I think I will have a bash with that laptop later today.
Best of luck! Shouldn't need it, if you have some idea what you are
doing, OpenBSD is one of the easiest systems to install and get
working nicely.
--Damian
------------------------------
Date: 27 Jul 2005 10:00:22 GMT
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: Numeric or character ?
Message-Id: <dc7lvm$gjs$3@mamenchi.zrz.TU-Berlin.DE>
Sven-Thorsten Fahrbach <sven-thorsten.fahrbach@gmx.net> wrote in comp.lang.perl.misc:
> > In general, one checks if input conforms to a certain format by
> > using an appropriate regex match. In this case, it is a very
> > simple one:
> >
> > #!/usr/bin/perl
> >
> > use strict;
> > use warnings;
> >
> > my $input;
> >
> > $| = 1;
>
> I'm just being interested: is there any specific reason why you make
> output unbuffered here? I think it's not necessary for this script but
> maybe something has escaped me...
Autoflushing (which is more to the point than "unbuffered") isn't
exactly needed here, but it's convenient to have. Its main purpose
is to match the flushing behavior of STDOUT and STDERR so that messages
on both appear on the screen when they are printed, not when a buffer
happens to overflow. Otherwise, error messages and normal output may
appear out of sequence, which can be confusing.
I put "$| = 1" in all my scripts (not modules), and only take it out
when the script happens to do mass IO via STDOUT (as in a filter).
Anno
--
If you want to post a followup via groups.google.com, don't use
the broken "Reply" link at the bottom of the article. Click on
"show options" at the top of the article, then click on the
"Reply" at the bottom of the article headers.
------------------------------
Date: Wed, 27 Jul 2005 12:53:52 +0200
From: Sven-Thorsten Fahrbach <sven-thorsten.fahrbach@gmx.net>
Subject: Re: Numeric or character ?
Message-Id: <20050727125352.0dc01fdb.sven-thorsten.fahrbach@gmx.net>
On 27 Jul 2005 10:00:22 GMT
anno4000@lublin.zrz.tu-berlin.de (Anno Siegel) wrote:
> Sven-Thorsten Fahrbach <sven-thorsten.fahrbach@gmx.net> wrote in comp.lang.perl.misc:
> > > In general, one checks if input conforms to a certain format by
> > > using an appropriate regex match. In this case, it is a very
> > > simple one:
> > >
> > > #!/usr/bin/perl
> > >
> > > use strict;
> > > use warnings;
> > >
> > > my $input;
> > >
> > > $| = 1;
> >
> > I'm just being interested: is there any specific reason why you make
> > output unbuffered here? I think it's not necessary for this script but
> > maybe something has escaped me...
>
> Autoflushing (which is more to the point than "unbuffered") isn't
> exactly needed here, but it's convenient to have. Its main purpose
> is to match the flushing behavior of STDOUT and STDERR so that messages
> on both appear on the screen when they are printed, not when a buffer
> happens to overflow. Otherwise, error messages and normal output may
> appear out of sequence, which can be confusing.
>
> I put "$| = 1" in all my scripts (not modules), and only take it out
> when the script happens to do mass IO via STDOUT (as in a filter).
Okay, I know what it does, I just wasn't aware that this was kind of a custom among some programmers. When I need unbuffered output I let it go to STDERR usually which is unbuffered (or autoflushed if you prefer) by default.
------------------------------
Date: 27 Jul 2005 11:56:27 GMT
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: Numeric or character ?
Message-Id: <dc7spb$odo$1@mamenchi.zrz.TU-Berlin.DE>
Sven-Thorsten Fahrbach <sven-thorsten.fahrbach@gmx.net> wrote in comp.lang.perl.misc:
> On 27 Jul 2005 10:00:22 GMT
> anno4000@lublin.zrz.tu-berlin.de (Anno Siegel) wrote:
>
> > Sven-Thorsten Fahrbach <sven-thorsten.fahrbach@gmx.net> wrote in
> comp.lang.perl.misc:
[...]
> > > I'm just being interested: is there any specific reason why you make
> > > output unbuffered here? I think it's not necessary for this script but
> > > maybe something has escaped me...
> >
> > Autoflushing (which is more to the point than "unbuffered") isn't
> > exactly needed here, but it's convenient to have. Its main purpose
> > is to match the flushing behavior of STDOUT and STDERR so that messages
> > on both appear on the screen when they are printed, not when a buffer
> > happens to overflow. Otherwise, error messages and normal output may
> > appear out of sequence, which can be confusing.
> >
> > I put "$| = 1" in all my scripts (not modules), and only take it out
> > when the script happens to do mass IO via STDOUT (as in a filter).
>
> Okay, I know what it does, I just wasn't aware that this was kind of a
> custom among some programmers. When I need unbuffered output I let it go
> to STDERR usually which is unbuffered (or autoflushed if you prefer) by
> default.
It's not just preference. An autoflushed IO channel is still buffered,
the buffer just doesn't fill up so much. A truly unbuffered channel
would be very hard to use.
Otherwise, the purpose of "$| = 1" isn't that we want STDOUT autoflushed,
it's that there already *is* autoflushed output that merges with it,
and the merging is smoother when both are autoflushed.
The problem is often not visible when printing directly to the terminal,
because terminal output is usually line buffered (another form of automatic
flushing). When the output goes to a file or pipe, to "| more" for
instance, the difference becomes apparent. Watch this:
[anno4000@lublin ~/clpm]$ cat script
#!/usr/bin/perl
use strict; use warnings;
$| = shift || 0;
print "one\n";
warn "two\n";
print "three\n";
[anno4000@lublin ~/clpm]$ ./script |& more
two
one
three
4000@lublin ~/clpm]$ ./script 1 |& more
one
two
three
Only in the second (autoflushed) example does the output appear in
the sequence it is produced. That is the problem "$| = 1" avoids.
Anno
--
If you want to post a followup via groups.google.com, don't use
the broken "Reply" link at the bottom of the article. Click on
"show options" at the top of the article, then click on the
"Reply" at the bottom of the article headers.
------------------------------
Date: Wed, 27 Jul 2005 11:52:16 +0100
From: James Taylor <spam-block-@-SEE-MY-SIG.com>
Subject: Re: OT: Social responsibility when writing HTML
Message-Id: <ant271016480fNdQ@riscpc.jtnet>
In article <kLvFe.37659$Pf3.14017@fe2.news.blueyonder.co.uk>,
<axel@white-eagle.invalid.uk> wrote:
>
> James Taylor wrote:
> >
> > Which of the following techniques would *you* choose:
>
> Some of your [snipped] examples have nothing to do HTML as such,
> but just various things in webpages.
Yes, but they illustrate my point that a good web developer
should write defensively (and that very few people do so).
> > The vast majority of kiddie web
> > deeziners out there would be completely oblivious to the
> > existence of a choice, and anyway would pick (a) from every
> > selection just because it's the newest wizzy technology that
> > gives them the maximum scope for creativity
>
> That is their problem... as their clients may soon realise.
Agreed, although their clients generally have less clue than
they do and only bother to test the site on MSIE. The
clients certainly don't bother to look "under the hood" to
check whether the site has been defensively coded.
> > Not only does the appallingly fragile construction of most
> > websites reduce the general quality of the web, but it also
> > imposes a pressure of extinction on minority browsers and
> > platforms that don't have sufficient market share and
> > financial muscle to keep up with the grubby complexity that
> > results from this.
>
> Is that not a reason to keep to standards?
Sure. I'm certainly not advocating deviation from any standards.
I'm advocating creating pages *within* the standards in such a
way that degrades gracefully, and uses the minimum technology
to achieve the requirements of the site. I'm suggesting
people learn a social conscience and try to be inclusive to
older browsers and simpler hand-coded web clients etc. I'm
saying don't make it impossible for anything but the latest
bleeding edge bloatware browser to access, otherwise that'll
be the only browser that gets sufficient development time to
keep up and all the other platforms will perish. People have
been compounding the Microsoft monopoly like that for far too
long as it is, and the result is that a crap system thrives
while excellent alternative systems whither on the vine.
> > Alternative platforms have much to offer and, just as we
> > should look after the bio-diversity of the rainforest, we
> > should avoid needlessly killing off computing platforms in a
> > mindless lust for the latest kewl thing, otherwise we'll
> > look back and wonder why we didn't see it coming when some
> > megacorp owns the world and there are no freedoms left.
>
> Which computing platforms are being killed off?
Well, personally I use RISC OS. It blows most other systems
out of the water for sheer fluid productivity, but shortage
of software development has left it struggling to keep up
with modern web technology. Not being able to access many
important websites has driven people away from the platform,
reducing the market share, thus reducing the potential sales
for developers so they develop for other systems instead,
leading to a shortage of developers and thus a vicious
circle of decline. One of the primary forces behind my
beloved platform's decline is the thoughtless use of newer
web technology by most web designers, and by thoughtless I
mean things like javascript sniffers that test for MSIE and
NN then raise an error if it doesn't match and also don't
have any alternative content between the <noscript> tags.
The idiots who do that kind of thing not only harm their
own site and the web in general, but their social
irresponsibility also wounds all minority browsers and
platforms (including mine) and for that they should be shot.
> Hardly Solaris - I have both Sparc and Intel editions at home
> and they run quite well without regard to any HTML standard.
> HP-UX? A system I would run Oracle on, not a web browser.
If you think "alternative" necessarily means a unix derivative,
you've been leading a very insular lifestyle.
> > So you see, you might think it's a small thing, but when I
> > see someone advocating the use of fragile markup (needlessly)
> > in the full knowledge that some browsers won't cope with it
> > and suggesting that browsers should just get fixed and
> > upgraded, I hope you now see why I oppose this socially
> > harmful and myopic attitude as a matter of utmost principle.
>
> No. If a browser cannot cope with good markup - it is the
> fault of the browser. Being able to cope with bad markup is
> a plus sign.
I understand this point of view, but it overlooks the social
responsibility web authors should feel to be as inclusive as
possible when publishing. Perhaps my command of English is
not sufficient to be persuasive, or perhaps I'm just not making
myself clear, but I can't believe I'm the only web developer
to understand this essential principle. God I hope not!
> I design the webpages from my own site (no, I am not going to
> make a plug for it as it would be of little interest to anyone)
> to be Lynx viewable - except those containing photographs.
Good start.
--
James Taylor, London, UK PGP key: 3FBE1BF9
To protect against spam, the address in the "From:" header is not valid.
In any case, you should reply to the group so that everyone can benefit.
If you must send me a private email, use james at oakseed demon co uk.
------------------------------
Date: Wed, 27 Jul 2005 13:01:24 +0100
From: James Taylor <spam-block-@-SEE-MY-SIG.com>
Subject: Re: OT: Social responsibility when writing HTML
Message-Id: <ant271224d58fNdQ@riscpc.jtnet>
In article <slrnded68m.7fo.abigail@alexandra.abigail.nl>,
Abigail <abigail@abigail.nl> wrote:
>
> James Taylor wrote:
> >
> > In article <slrndeat4j.7fo.abigail@alexandra.abigail.nl>,
> > Abigail <abigail@abigail.nl> wrote:
> > >
> > > Furthermore, I cannot imagine a "good, anticiapting programmer"
> > > writing < instead of '<' inside quotes for the "difficulties"
> > > someone might have parsing HTML, and then leaving off the quotes.
> >
> > Perhaps, but the parser has to cope with HTML from both experts
> > *and* amateurs. To cope with missing quotes from amateurs,
> > it might choose to treat the first > as the tag terminator
> > then look to see if it can make sense of the tag contents.
>
> This is the one of the most remarkable pieces of bullshit I've
> ever seen.
Really? Is that a good thing? ;-)
> The only reason people (used) to be able "to get away" with
> not using a closing quote was the losing coding talents of
> Marc Andreessen and his seven little dwarves.
What makes you think Mosaic derivatives are the only
browsers that behaved that way?
> > It occurs to me that you may be confusing this hypothetical
> > parser with one that I would write, but that's not my point.
>
> Well, it was you who didn't know you could use a '>' inside
> an attribute value, and it was you would said HTML would
> "get what they deserve" if they used '>' inside an attribute
> value (instead of >), so you were giving me all the reasons
> to assume you would write an HTML parser in such a way.
You're entitled to your opinion. I could defend myself
by saying that if I were writing a proper parser I'd start
with the standards. But, as I said, THIS IS NOT MY POINT.
> Well, there *have* been browsers that *didn't* do entity
> expansion inside attribute values, so if you would
> "defend" against those, you wouldn't write '>' inside
> an attribute value, but '>'.
Sheesh! Sounds like the only safe thing to do is avoid the use
of '>' in any form within attribute values. Thankfully, I don't
believe there are any situations where it is actually
necessary to put angle brackets in HTML attribute values.
> > > I really hate that attitude. Instead of blaming the people
> > > writing buggy browsers, or other bad parsers, you blame the
> > > people writing HTML!
> >
> > That's because web developers should know better and anyway
> > can make corrections easily, whereas on many minority
> > computing platforms there is no choice of web browser. The
> > user has to use what's available, or write their own which
> > is usually not practical or even possible.
>
> And that's how bad web browsers stay in business. Why
> bother fixing your shitty product, if everyone else will
> fix their correct code?
I don't understand why you're being so unforgiving towards
browser producers. On many platforms there is little choice
of browser and, when a better one comes along, users have
good reason to be grateful *even* if it's not perfect. In
fact, I don't believe any browser on any platform is ever
likely to be perfect. That might be an irritating wrinkle in
reality for you, but a reality nevertheless.
I'm not saying browsers shouldn't get improved, I'm just saying
that HTML authors should be considerate. I hate the attitude
that says "damn anyone stuck using a less capable browser, as
I don't intend to make the slightest effort to include them".
People with that attitude have ruined the web, and supported
the big bloatware browsers along with the monopolistic
platforms that run them to the detriment of any alternatives.
It's myopic, socially harmful, irresponsible and ignorant.
--
James Taylor, London, UK PGP key: 3FBE1BF9
To protect against spam, the address in the "From:" header is not valid.
In any case, you should reply to the group so that everyone can benefit.
If you must send me a private email, use james at oakseed demon co uk.
------------------------------
Date: Wed, 27 Jul 2005 20:47:39 +1000
From: Cameron McCormack <"See signature for e-mail address:;">
Subject: Perl performance issue
Message-Id: <42e76687$1@quokka.wn.com.au>
Hi everyone.
I am migrating my web/mail/svn/etc. servers from a computer connected to
my ADSL at home, an old Athlon 800, to a hosted Celeron 2.4GHz machine.
I found though that Perl runs much more slowly on the new machine and I
really don't know why. The problem seems to show itself mostly when
loading modules (though this could just be because there is lots of
code in the modules).
For example on my old machine:
jet:~ $ for x in . . .; do time perl -MCPAN -e1; done
real 0m0.167s
user 0m0.158s
sys 0m0.008s
real 0m0.166s
user 0m0.156s
sys 0m0.009s
real 0m0.167s
user 0m0.159s
sys 0m0.007s
and on the new machine:
arc:~ $ for x in . . .; do time perl -MCPAN -e1; done
real 0m2.310s
user 0m2.280s
sys 0m0.030s
real 0m2.320s
user 0m2.270s
sys 0m0.050s
real 0m2.326s
user 0m2.300s
sys 0m0.030s
Actually, even without loading the CPAN module there is an appreciable
difference:
port:~ $ for x in . . .; do time perl -e1; done
real 0m0.009s
user 0m0.004s
sys 0m0.005s
real 0m0.010s
user 0m0.004s
sys 0m0.006s
real 0m0.009s
user 0m0.005s
sys 0m0.003s
arc:/tmp $ for x in . . .; do time perl -e1; done
real 0m0.069s
user 0m0.060s
sys 0m0.000s
real 0m0.067s
user 0m0.060s
sys 0m0.000s
real 0m0.069s
user 0m0.060s
sys 0m0.010s
I did multiple tests to (hopefully) discount issues of disk speed. Both
machines are using the same Debian package versions (5.8.7-4).
Anyone know why this might be (with the little information I've given)
or be able to help me diagnose the problem properly?
Also, if there's a more appropriate forum for this question, please
point me towards it.
Thanks,
Cameron
--
e-mail : cam (at) mcc.id.au icq : 26955922
web : http://mcc.id.au/ msn : cam-msn (at) aka.mcc.id.au
office : +61399055779 jabber : heycam (at) jabber.org
------------------------------
Date: Tue, 26 Jul 2005 21:37:07 -0400
From: Penguin_X <penguin_x@phreaker.net>
Subject: Wget-like for Perl
Message-Id: <hyBFe.70234$mv2.1287132@weber.videotron.net>
Hi All ! First of all, sorry for my poor English. I'm still working on that.
I'm looking to build a program in Perl that download HTML code from many
web pages. I'm looking for something like "wget" that may GET a html
page and save in onto my HD. Everything else is fine, except that.
The goal is to build a SMS-News Sender via SMTP protocol. You know that
you can't send more than 128 characters at the same time with SMS, so I
can't have my news on cellular. I want to wrote something that will
extract only important stuff from many websites and send only one e-mail
via SMS. A Maximum 120 characters per e-mail.
Thanks a lot !
Truly.
------------------------------
Date: Wed, 27 Jul 2005 09:08:42 +0200
From: Josef Moellers <josef.moellers@fujitsu-siemens.com>
Subject: Re: Wget-like for Perl
Message-Id: <dc7bp5$616$1@nntp.fujitsu-siemens.com>
Penguin_X wrote:
> Hi All ! First of all, sorry for my poor English. I'm still working on =
> that.
>=20
> I'm looking to build a program in Perl that download HTML code from man=
y=20
> web pages. I'm looking for something like "wget" that may GET a html =
> page and save in onto my HD. Everything else is fine, except that.
Have a look at the LWP modules on a CPAN mirror near you.
--=20
Josef M=F6llers (Pinguinpfleger bei FSC)
If failure had no penalty success would not be a prize
-- T. Pratchett
------------------------------
Date: Wed, 27 Jul 2005 08:12:50 -0400
From: Penguin_X <penguin_x@phreaker.net>
Subject: Re: Wget-like for Perl
Message-Id: <cSKFe.95685$mv2.1578214@weber.videotron.net>
Josef Moellers wrote:
> Penguin_X wrote:
>> Hi All ! First of all, sorry for my poor English. I'm still working on
>> that.
>>
>> I'm looking to build a program in Perl that download HTML code from
>> many web pages. I'm looking for something like "wget" that may GET a
>> html page and save in onto my HD. Everything else is fine, except that.
>
> Have a look at the LWP modules on a CPAN mirror near you.
>
Thank, i'm looking for that :)
------------------------------
Date: Tue, 26 Jul 2005 21:26:26 -0400
From: "Hooby" <andygillanders@xxnospamxx.charter.net>
Subject: XML::Parser - trapping badly formed XML ?
Message-Id: <WoBFe.7771$VG6.5489@fe07.lga>
I have been using the wonderful XML::Parser on a winXP box successfully for
a long time now. Unfortunately, I have several (hundred?) thousand XML files
that I process on a weekly basis. Every so often - say 1 in 10,000 might be
badly formed (but which one?). When XML::Parser hits one of these it dies
(just as the documentation says it would). BTW - I have no control over the
badly formed XML if it occurs - I just have deal with what I am given...
Is there a way to trap or change this behaviour so that I can pass over the
offending file gracefully and let the program continue with the others (it
takes several hours to complete - amd I don't mind missing one file
occasionally). In other words can I trap the error in perl to make it a warn
not a die?
Any suggestions gratefully received!
Thanks Andy
Typical usage as seen below :
use XML::Parser;
$parser = new XML::Parser(Style=>'Subs', Pkg=>'SubHandlers', ErrorContext =>
2);
$parser->setHandlers( Start => \&startElement,
End => \&endElement,
Char => \&characterData
);
$currentfile = $filename;
$parser->parsefile($currentfile); # open up and parse the classification
scheme to find out what filelists were created and generate indexes as it
goes
------------------------------
Date: Wed, 27 Jul 2005 04:18:56 GMT
From: Kevin Michael Vail <kevin@vaildc.net>
Subject: Re: XML::Parser - trapping badly formed XML ?
Message-Id: <kevin-E0662A.00185627072005@news.verizon.net>
In article <WoBFe.7771$VG6.5489@fe07.lga>,
"Hooby" <andygillanders@xxnospamxx.charter.net> wrote:
> I have been using the wonderful XML::Parser on a winXP box successfully for
> a long time now. Unfortunately, I have several (hundred?) thousand XML files
> that I process on a weekly basis. Every so often - say 1 in 10,000 might be
> badly formed (but which one?). When XML::Parser hits one of these it dies
> (just as the documentation says it would). BTW - I have no control over the
> badly formed XML if it occurs - I just have deal with what I am given...
>
> Is there a way to trap or change this behaviour so that I can pass over the
> offending file gracefully and let the program continue with the others (it
> takes several hours to complete - amd I don't mind missing one file
> occasionally). In other words can I trap the error in perl to make it a warn
> not a die?
>
> Any suggestions gratefully received!
perldoc -f eval
> Typical usage as seen below :
>
> use XML::Parser;
> $parser = new XML::Parser(Style=>'Subs', Pkg=>'SubHandlers', ErrorContext =>
> 2);
> $parser->setHandlers( Start => \&startElement,
> End => \&endElement,
> Char => \&characterData
> );
> $currentfile = $filename;
> $parser->parsefile($currentfile); # open up and parse the classification
> scheme to find out what filelists were created and generate indexes as it
> goes
eval { $parser->parsefile($currentfile); };
if ($@) {
## an error occurred
}
--
Bright eyes/burning like fire, | Kevin Michael Vail
Bright eyes/how can you close and fail? | kevin@vaildc.net
How can the light that shone so brightly | . . . . . . . . . .
Suddenly shine so pale?/Bright eyes | . . . . . . . . .
------------------------------
Date: 6 Apr 2001 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 6 Apr 01)
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: due to the current flood of worm email banging on ruby, the smtp
server on ruby has been shut off until further notice.
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 V10 Issue 8281
***************************************