[27228] in Perl-Users-Digest
Perl-Users Digest, Issue: 9019 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sun Mar 5 03:05:53 2006
Date: Sun, 5 Mar 2006 00:05:04 -0800 (PST)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Perl-Users Digest Sun, 5 Mar 2006 Volume: 10 Number: 9019
Today's topics:
Re: Different results parsing a XML file with XML::Simp robic0
Re: Different results parsing a XML file with XML::Simp robic0
Load perl module dynamically (use $object) <markus.dehmann@gmail.com>
Re: making your OS collapse by using Perl <dmercer@mn.rr.com>
Re: making your OS collapse by using Perl (Rick Scott)
Re: simple pointer operations (newbe) <tassilo.von.parseval@rwth-aachen.de>
Re: Smart::Comments overwritting? <astewart1@cox.net>
Re: Weighing the evidence, Perl is a GUESSING game !! robic0
Re: Weighing the evidence, Perl is a GUESSING game !! robic0
Re: Weighing the evidence, Perl is a GUESSING game !! <jurgenex@hotmail.com>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Sat, 04 Mar 2006 17:30:09 -0800
From: robic0
Subject: Re: Different results parsing a XML file with XML::Simple (XML::Sax vs. XML::Parser)
Message-Id: <d1fk02pfdc3q1b3aqogm7qcominehflu23@4ax.com>
On Thu, 02 Mar 2006 15:57:53 GMT, "A. Sinan Unur" <1usa@llenroc.ude.invalid> wrote:
>fuzz@uni-paderborn.de (Erik Wasser) wrote in
>news:nsejd3-rep.ln1@wasser-7359.user.cis.dfn.de:
>
>> I'm subject to some confusion with XML and UTF8. I'm working with
>> XML-Simple and I try to decode some XML with with german umlauts
>> (ISO-8859-1). The first XML line declared the encoding correct (see
>> code below). But I'm getting different results using XML-Simple with
>> the default XML parser named XML::Sax and a second parser named
>> XML::Parser. The following code tries to decode the mini XML file and
>> prints the UTF8 flags of the resulting strings.
>>
>> Can someone run this code on his machine and post the results? Thanks.
>> The results on my machine are this:
>>
You didn't try to decode in German! You might have changed the "code page"
to German to get different character sets. It doesn't matter. I'm looking at
your character in whatever "code page" is on my machine. UTF8 is Unicode.
Its not discernable unless you have a Unicode "aware" renderer. You can't
just change the characters on the page via cut & paste and it turns into
Unicode. If you open or save a Unicode document from a Unicode aware editor
the represented character will not be noticable as Unicode, so it's not
something that can be "cut 'n pasted" into a newsgroup, as code to be
tested! UTF8, even "multi-byte" is transparent to the user and only known
to the renderer. Data from a file that is read into a parser (or a Perl
program that is UTF8 aware) that is Unicode is treated as Unicode in its
variable representation and interaction with other variables. If a regex
is to be applied to Unicode data from an aware Perl parser, it works
every time.
------------------------------
Date: Sat, 04 Mar 2006 17:43:12 -0800
From: robic0
Subject: Re: Different results parsing a XML file with XML::Simple (XML::Sax vs. XML::Parser)
Message-Id: <l7gk029sh26s7d5l4p1gumi2qvcngqnhfr@4ax.com>
On Sat, 04 Mar 2006 17:30:09 -0800, robic0 wrote:
>On Thu, 02 Mar 2006 15:57:53 GMT, "A. Sinan Unur" <1usa@llenroc.ude.invalid> wrote:
>
>>fuzz@uni-paderborn.de (Erik Wasser) wrote in
>>news:nsejd3-rep.ln1@wasser-7359.user.cis.dfn.de:
>>
>>> I'm subject to some confusion with XML and UTF8. I'm working with
>>> XML-Simple and I try to decode some XML with with german umlauts
>>> (ISO-8859-1). The first XML line declared the encoding correct (see
>>> code below). But I'm getting different results using XML-Simple with
>>> the default XML parser named XML::Sax and a second parser named
>>> XML::Parser. The following code tries to decode the mini XML file and
>>> prints the UTF8 flags of the resulting strings.
>>>
>>> Can someone run this code on his machine and post the results? Thanks.
>>> The results on my machine are this:
>>>
>
>You didn't try to decode in German! You might have changed the "code page"
>to German to get different character sets. It doesn't matter. I'm looking at
>your character in whatever "code page" is on my machine. UTF8 is Unicode.
>Its not discernable unless you have a Unicode "aware" renderer. You can't
>just change the characters on the page via cut & paste and it turns into
>Unicode. If you open or save a Unicode document from a Unicode aware editor
>the represented character will not be noticable as Unicode, so it's not
>something that can be "cut 'n pasted" into a newsgroup, as code to be
>tested! UTF8, even "multi-byte" is transparent to the user and only known
>to the renderer. Data from a file that is read into a parser (or a Perl
>program that is UTF8 aware) that is Unicode is treated as Unicode in its
>variable representation and interaction with other variables. If a regex
>is to be applied to Unicode data from an aware Perl parser, it works
>every time.
Just a followup, I know your question was with xml, but if you wan't to use
unicode "outside" the 0-128 bracket fro regex you might want to use the
codes as in this simple example (which just uses various "ranges"):
@UC_Nstart = (
"\\x{C0}-\\x{D6}",
"\\x{D8}-\\x{F6}",
"\\x{F8}-\\x{2FF}",
"\\x{370}-\\x{37D}",
"\\x{37F}-\\x{1FFF}",
"\\x{200C}-\\x{200D}",
"\\x{2070}-\\x{218F}",
"\\x{2C00}-\\x{2FEF}",
"\\x{3001}-\\x{D7FF}",
"\\x{F900}-\\x{FDCF}",
"\\x{FDF0}-\\x{FFFD}",
"\\x{10000}-\\x{EFFFF}",
);
------------------------------
Date: Sun, 05 Mar 2006 00:36:32 -0500
From: Markus Dehmann <markus.dehmann@gmail.com>
Subject: Load perl module dynamically (use $object)
Message-Id: <46vbn1Fcrqh6U1@individual.net>
Can I load perl modules dynamically?
In other words, I want to do something like this:
my $obj = "Getopt::Long";
eval{ use $obj } or die($@);
But it doesn't work like that. Is such a dynamic module loading possible
at all?
Markus
------------------------------
Date: Sun, 05 Mar 2006 00:06:29 GMT
From: "Dan Mercer" <dmercer@mn.rr.com>
Subject: Re: making your OS collapse by using Perl
Message-Id: <9YpOf.8962$iR1.5455@tornado.rdc-kc.rr.com>
"Randal L. Schwartz" <merlyn@stonehenge.com> wrote in message news:86wtfa9qnn.fsf@blue.stonehenge.com...
: >>>>> "Lars" == Lars <for_usenet_use@arcor.de> writes:
:
: Lars> Did you ever notice that simply typing "perl -e 'fork while 1'" makes
: Lars> your operating system irresponsive, so a reset is required? This is
: Lars> especially fatal for a web server that runs a CGI script containing
: Lars> contains (by chance) the line 'fork while 1'.
:
: Lars> This seems to at least hold for the Linux OS.
:
: Have you ever noticed that when you poke yourself in the eye with a sharp
: stick, it hurts really bad, and you could have permanent damage?
:
: What exactly is your point? "Don't do that"?
:
: Or are you just trying to make sure as many of your scriptkiddy friends know
: about a simple boring DoS attack on a box for which they have execution
: rights?
:
: {sigh}
:
: print "Just another Perl hacker,"; # the original
Actually, Randal, a proper UNIX/Linux installation will have no such problem.
Only a rank amateur who sets maxuprc close to or equal to nprocs. Maxuprc
is the maximum number of processes a single user can have open, nprocs is the
number of slots in the process table. Root is not limited by nprocs but
only an idiot would use a root login routinely or allow root access to CGI.
Reminds me of the old Christopher Guest/Billy Crystal SNL routine - "You know
what I hate - I hate when you put that thing, that thing?"
"A power drill?"
"Right, in your ear and turn it on and press. I hate when I do that"
Dan Mercer
:
: --
: Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
: <merlyn@stonehenge.com> <URL:http://www.stonehenge.com/merlyn/>
: Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
: See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!
: *** Free account sponsored by SecureIX.com ***
: *** Encrypt your Internet usage with a free VPN account from http://www.SecureIX.com ***
------------------------------
Date: Sun, 05 Mar 2006 01:35:51 -0000
From: rick@shadowspar.dyndns.org (Rick Scott)
Subject: Re: making your OS collapse by using Perl
Message-Id: <1141522685.6FfdC.1299@shadowspar>
(Lars <for_usenet_use@arcor.de> uttered:)
> Did you ever notice that simply typing "perl -e 'fork while 1'" makes
> your operating system irresponsive, so a reset is required? This is
> especially fatal for a web server that runs a CGI script containing
> contains (by chance) the line 'fork while 1'.
>
> This seems to at least hold for the Linux OS.
http://catb.org/~esr/jargon/html/F/fork-bomb.html
1) This isn't specific to Perl. Fork bombs are old hat.
2) A properly configured *nix box is quite resilient in the face of
such an attack. In such cases, all that a fork bomb will
accomplish is getting you kicked off of the system by an irritable
sysadmin.
3) Webserver processes in particular really, really need to have sane
limits imposed on them anyway. Amongst other things, bugs in CGI
scripts can cause your webserver to eat its way through processes
or RAM quite quickly. If it starts going berzerk, there should
already be some control mechanism in place to rein it in before it
brings the whole box to its knees.
See also 'man ulimit' or 'man limits.conf' depending on your OS.
Rick
--
key CF8F8A75 / print C5C1 F87D 5056 D2C0 D5CE D58F 970F 04D1 CF8F 8A75
Pray to God, but continue rowing towards the shore.
:Russian proverb
------------------------------
Date: Sun, 5 Mar 2006 09:01:52 +0100
From: "Tassilo v. Parseval" <tassilo.von.parseval@rwth-aachen.de>
Subject: Re: simple pointer operations (newbe)
Message-Id: <46vk7jFd1mpnU1@news.dfncis.de>
Also sprach Uri Guttman:
>>>>>> "AS" == Anno Siegel <anno4000@lublin.zrz.tu-berlin.de> writes:
>
> AS> Uri Guttman <uri@stemsystems.com> wrote in comp.lang.perl.misc:
>
> >> the sv (or whatever the internal thing the ref is) never get reallocated
> >> as they are fixed sized. only the string/array/hash buffers get
> >> reallocated as needed and they are pointed to by a member of the sv. so
> >> the ref value will never change as long as the ref is valid (not garbage
> >> collected).
>
> AS> There is one exception: On thread (ithread) creation, everything is
> AS> cloned and one of the branches wakes up with all refaddrs changed.
>
> AS> That's why some implementations of inside-out classes aren't thread-safe.
> AS> An object in a newly cloned thread will appear to have lost its data.
> AS> The problem is fixable, at a price.
>
> AS> As far as I'm concerned thread users get what they deserve and deserve
> AS> what they get :)
>
> as a strong advocate of event loops over threads i fully agree with that
> sentiment. :)
And as someone having done quite a bit with events myself, I have to
mention that they are two totally different things. :)
Although you can sometimes get away with events and avoid threads or
processes, you will still need some means of real concurrency. Whenever
an event handler may block or carry out a complex computation that takes
a while, you have to run it in a separate process or thread or otherwise
your event loop will block for the time the handler is running.
Well, I know that you know that. But for Event::Lib, I received quite a
few mails from people who were apparently under the misapprehension that
each event handler is triggered in its own process or thread. An
event-based application is still running sequentially so it will not
always spare one the pain to use fork() or threads.
Tassilo
--
use bigint;
$n=71423350343770280161397026330337371139054411854220053437565440;
$m=-8,;;$_=$n&(0xff)<<$m,,$_>>=$m,,print+chr,,while(($m+=8)<=200);
------------------------------
Date: Sat, 04 Mar 2006 16:03:36 -0800
From: Alan Stewart <astewart1@cox.net>
Subject: Re: Smart::Comments overwritting?
Message-Id: <1jak02h80r5n3r1ugj36kj7g0smja6bvrr@4ax.com>
On Sat, 04 Mar 2006 09:44:30 +0000, Kirby James
<kirby@lkjh.wanadoo.co.uk> wrote:
>Hi,
>
>When I run the following programme (under Windows XP Command Prompt;
>ActiveState Perl 5.8.7; Smart::Comments 0.001) I get this output:-
>
>### variable: 1234
>
>: 1234ariable
>
>I has expected the final line to read '### $variable: 1234' - but it
>appears that the final ': 1234' has been written starting from the
>beginning of the line.
>
>I've looked at the Command Prompt properties - but can't see anything
>that would change this behaviour.
>
>Any suggestions appreciated.
>
>Thanks
>
>Kirby
>
>
>
>
>#
># simple.pl
>#
>
>use Smart::Comments;
>use strict;
>
>my $variable = 1234;
>
>### variable: $variable
>### $variable
Smart::Comments version 1.02 has this fixed.
Alan
------------------------------
Date: Sat, 04 Mar 2006 18:01:02 -0800
From: robic0
Subject: Re: Weighing the evidence, Perl is a GUESSING game !!
Message-Id: <2ihk0254ubgrec6k8o9pua721gcpf6sbi4@4ax.com>
On Thu, 02 Mar 2006 00:47:56 GMT, "A. Sinan Unur" <1usa@llenroc.ude.invalid> wrote:
>"Lukas Mai" <rwxr-xr-x@gmx.de> wrote in news:du569l$8s9$01$2@news.t-
>online.com:
>
>> robic0 schrob:
>
>...
>
>>> I'm writing this because of the recent avalance of bullshit
>>> on this subject by Abgail and Sunan and others on a single subject.
>
>...
>
>> You suck at spelling names.
>
>You are not giving him enough credit. ;-)
>
>He sucks at spelling any word.
>
>Sinan
Whatever u say Nissan
------------------------------
Date: Sat, 04 Mar 2006 18:03:46 -0800
From: robic0
Subject: Re: Weighing the evidence, Perl is a GUESSING game !!
Message-Id: <flhk02d1soldupop3alnjc96t8mf4p758t@4ax.com>
On Wed, 1 Mar 2006 17:47:33 -0500, "Matt Garrish" <matthew.garrish@sympatico.ca> wrote:
>
>"Uri Guttman" <uri@stemsystems.com> wrote in message
>news:x7veuyvjgz.fsf@mail.sysarch.com...
>>>>>>> "r" == robic0 <robic0> writes:
>>
>> r> I'm ready to go to the mat on this one ...
>>
>> i'd like to introduce you to moronzilla one day. the two of you would
>> make a very happy and loonie couple and you could go off inventing your
>> own languages.
>>
>
>At least Xah has a personal crusade against the unix f*ckheads who use Perl,
>and is almost convincing in his blather (though in a warped and demented
>kind of way).
I was brought in as a consultant to Xah's team, team FukUrHeadUp
------------------------------
Date: Sun, 05 Mar 2006 02:25:42 GMT
From: "Jürgen Exner" <jurgenex@hotmail.com>
Subject: Re: Weighing the evidence, Perl is a GUESSING game !!
Message-Id: <G_rOf.2315$_A4.345@trnddc06>
robic0 wrote:
> On Thu, 02 Mar 2006 00:47:56 GMT, "A. Sinan Unur"
>> He sucks at spelling any word.
>
> Whatever u say Nissan
^^^
|||
I rest my case :-)))
jue
------------------------------
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 9019
***************************************