[28365] in Perl-Users-Digest
Perl-Users Digest, Issue: 9729 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Sep 15 14:10:15 2006
Date: Fri, 15 Sep 2006 11:10: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 Fri, 15 Sep 2006 Volume: 10 Number: 9729
Today's topics:
Re: Preventing changes to a module's variables in mod_p max@maxgraphic.com
Re: Preventing changes to a module's variables in mod_p <nobull67@gmail.com>
Re: Preventing changes to a module's variables in mod_p max@maxgraphic.com
Re: Preventing changes to a module's variables in mod_p <nobull67@gmail.com>
Re: print cyriilic (UTF-8) characters with PERL on HTML <andreas.pfaff@swissonline.ch>
Re: String buffer instead of file handle? <mritty@gmail.com>
Re: String buffer instead of file handle? <tzz@lifelogs.com>
Re: String buffer instead of file handle? <spamhole@ntp.isc.org>
Re: String buffer instead of file handle? <dha@panix.com>
Re: String buffer instead of file handle? <danparker276@yahoo.com>
Re: String buffer instead of file handle? <uri@stemsystems.com>
Re: username passwd expect <rvtol+news@isolution.nl>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 15 Sep 2006 08:58:13 -0700
From: max@maxgraphic.com
Subject: Re: Preventing changes to a module's variables in mod_perl
Message-Id: <1158335893.853627.95860@i42g2000cwa.googlegroups.com>
Brian McCauley wrote:
> max@maxgraphic.com wrote:
>
> > I have a module that exists as a central data store, returning simple
> > scalars or references to larger structures. All of its data is stored
> > in a big hash, and I use AUTOLOAD to return the requested value.
> >
> > The problem is that, with mod_perl, if the script that uses the module
> > changes the data (which with auto-vivication is pretty easy), the data
> > is changed for all subsequent scripts using that module run by that
> > particular apache child, which leads to the usual hair-pulling
> > intermittent bugs that mod_perl users historically puzzle over.
> >
> > I've looked at a couple locking options, but the problem is that the
> > data can be arbitrarily deep references (which seems to rule out
> > Hash::Util).
>
> The Readonly module claims to recursively follow deep structures (by
> default).
>
> Is there a reason you can't simply make the central data store readonly?
Thanks. I had tried using Storable's dclone to return a copy, which
worked but was about a hundred times slower than just returning a
reference. Readonly seems to only be about four times slower.
Is there a way to get Readonly to warn instead of die when a
modification attempt is made?
------------------------------
Date: 15 Sep 2006 09:16:43 -0700
From: "Brian McCauley" <nobull67@gmail.com>
Subject: Re: Preventing changes to a module's variables in mod_perl
Message-Id: <1158337003.873283.168490@m73g2000cwd.googlegroups.com>
max@maxgraphic.com wrote:
> Is there a way to get Readonly to warn instead of die when a
> modification attempt is made?
There's no such feature at the moment but it would be no biggie to add
if you wanted to. Just change the croaks() to carps().
------------------------------
Date: 15 Sep 2006 09:59:36 -0700
From: max@maxgraphic.com
Subject: Re: Preventing changes to a module's variables in mod_perl
Message-Id: <1158339576.108934.187230@e3g2000cwe.googlegroups.com>
Brian McCauley wrote:
> max@maxgraphic.com wrote:
>
> > Is there a way to get Readonly to warn instead of die when a
> > modification attempt is made?
>
> There's no such feature at the moment but it would be no biggie to add
> if you wanted to. Just change the croaks() to carps().
Seemingly better still, Readonly uses its own croak wrapper, so adding
sub Readonly::croak { warn $_[0]; }
to my module seems to do the trick.
Thanks again for your help.
------------------------------
Date: 15 Sep 2006 10:50:10 -0700
From: "Brian McCauley" <nobull67@gmail.com>
Subject: Re: Preventing changes to a module's variables in mod_perl
Message-Id: <1158342610.366870.43500@b28g2000cwb.googlegroups.com>
max@maxgraphic.com wrote:
> Brian McCauley wrote:
> > max@maxgraphic.com wrote:
> >
> > > Is there a way to get Readonly to warn instead of die when a
> > > modification attempt is made?
> >
> > There's no such feature at the moment but it would be no biggie to add
> > if you wanted to. Just change the croaks() to carps().
>
> Seemingly better still, Readonly uses its own croak wrapper, so adding
>
> sub Readonly::croak { warn $_[0]; }
>
> to my module seems to do the trick.
You'd probably get more informative errors with
sub Readonly::croak {
require Carp;
goto &Carp::carp;
}
The problem with this approach is it breaks any other uses of Readonly
that are going on in other modules that anyone who happens to use your
module is also using.
------------------------------
Date: 15 Sep 2006 05:36:44 -0700
From: "andipfaff" <andreas.pfaff@swissonline.ch>
Subject: Re: print cyriilic (UTF-8) characters with PERL on HTML page
Message-Id: <1158323804.261656.295780@e3g2000cwe.googlegroups.com>
Thanks,
that's exactly the answer I was waiting for!
Have a nice weekend
Andi
peter_emmerich schrieb:
> Hi Andi,
>
> assuming you are working with a script running on a webserver (you
> mentioned print qq(Content-type: text/html;.....)) here is the perl
> code you need at least to print unicode/utf-8 with a script:
>
> #!/usr/bin/perl -w
> use CGI;
> $my_string =3D qq(=C3=A4 =C3=B6 =C3=BC =C3=A0 =C3=A9 =C3=A8 =C3=84 =C3=96=
=C3=9C =D0=96 =D0=B6 =D0=97 =D0=B7 =D0=98 =D0=B8 =D0=99 =D0=B9);
> print qq(Content-type: text/html; charset=3Dutf-8\n\n
> <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
> <html>
> <head>
> <META HTTP-EQUIV=3D"CONTENT-TYPE" content=3D"text/html; charset=3Dutf-8">
> <title>UTF-8 Testpage</title>
> </head>
> <body>
> $my_string
> </body>
> </html>
> );
>
> Create the file with Windows Notepad or Notepad++ or another Unicode
> capable editor in UTF-8 format, otherwise it will not work!
>
> Best regards
> PE
>
> andipfaff schrieb:
>
> > Hi there,
> >
> > beginners question: I have written a small website with a PERL script
> > which can be viewed in 4 western european languages. Each text to be
> > displayed is stored in arrays like
> > $text1[1] =3D qq(Hallo);
> > $text1[2] =3D qq(Salut);
> > $text1[3] =3D qq(Saluti);
> > $text1[4] =3D qq(Hello);
> > and printed to STDOUT. Now I want to extend this with cyrillic
> > characters (5th language: russian). Unfortunately I have no idea how to
> > do that. I simply tried to cut&paste cyrillic letters from websites
> > like wikipedia cyrillic aplphabet, but in my Editor (DZSoft) I just get
> > a question mark when pasting. In Notepad pasting is OK, because he is
> > capable of UTF-8. DZSoft does not seem to be.
> >
> > What are the minimum requirements to print a cyrillic character with
> > PERL into a website? I am working with Windows 2k english or german,
> > IIS 5 on a W2k Server, ActiveState PERL, and a MySQL database.
> >
> > The PERL script is using CGI, but HTML code is written directly:
> > print qq(Content-type: text/html\n\n
> > <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
> > "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
> > <html>
> > <head> etc.
> >
> > Does anybody can give me a simple script which I can test with Notepad
> > as en editor?
> >=20
> > Thanks in advance
> > Andi Pfaff
------------------------------
Date: 15 Sep 2006 03:46:14 -0700
From: "Paul Lalli" <mritty@gmail.com>
Subject: Re: String buffer instead of file handle?
Message-Id: <1158317174.757232.162880@p79g2000cwp.googlegroups.com>
Ottis Caw wrote:
> The biggest problem with this group and others that display the same
> attitudes, is that many who frequent this group seem to presume that
> most, shall we say, inexperienced users are automatically clueless.
On the contrary. If we were to assume "newbies" are clueless, we would
assume they're incapable of doing any research on their own, and would
feel it necessary to hand-feed answers. By pointing people to
documentation, we are giving them the benefit of the doubt that they
are capable of learning on their own, if only they know about the
proper resources.
Paul Lalli
------------------------------
Date: Fri, 15 Sep 2006 11:05:14 -0400
From: Ted Zlatanov <tzz@lifelogs.com>
Subject: Re: String buffer instead of file handle?
Message-Id: <g69psdxqifp.fsf@CN1374059D0130.kendall.corp.akamai.com>
On 14 Sep 2006, danparker276@yahoo.com wrote:
> Ted Zlatanov wrote:
>> On 14 Sep 2006, danparker276@yahoo.com wrote:
>>
>>> being a .net programmer puts me on a higher evolutionary scale, and
>>> I get more chicks that way.
>>
>> So you've evolved into a chicken? That explains a *lot* about .Net
>> programmers.
> Serious? Was that supposed to be funny? I scored with 2 chicks last
> weekend! Think about that next time your home alone on friday night.
I made a joke because the stupidity of your original statement set it
up nicely. I see it wasn't necessary, you're funnier on your own.
Ted
------------------------------
Date: Fri, 15 Sep 2006 08:19:53 -0700
From: "Steve K." <spamhole@ntp.isc.org>
Subject: Re: String buffer instead of file handle?
Message-Id: <4mvukqF7vpnrU1@individual.net>
David Squire wrote:
> Steve K. wrote:
>> Mumia W. wrote:
>>> On 09/13/2006 05:31 PM, danparker276@yahoo.com wrote:
>>>> Tad,
>>>> " open($fh, '>', \$variable)" This would work perfect, just not
>>>> the right version of perl. [...]
>>>
>>> Do you mean that you can't install and use IO::Scalar?
>>
>> That assumes he knows of it. Why can't anyone realize not everyone
>> memorizes all of CPAN by heart.
>
> It had already been pointed out to him in this thread. Why can't some
> folk check a thread before jumping in?
Sorry, it was a lengthy thread, though I could of checked on google,
though I was just casually reading some posts before calling it a day
and just happened to reply.
For what it's worth, the tone the thread seemed to be moving towards did
not seem like it would yield much helpful. Lets just say I've seen this
how many of these types of thread end up going.
------------------------------
Date: Fri, 15 Sep 2006 16:22:50 +0000 (UTC)
From: "David H. Adler" <dha@panix.com>
Subject: Re: String buffer instead of file handle?
Message-Id: <slrneglkqq.d39.dha@panix2.panix.com>
On 2006-09-15, Steve K. <spamhole@ntp.isc.org> wrote:
>
> For what it's worth, the tone the thread seemed to be moving towards did
> not seem like it would yield much helpful. Lets just say I've seen this
> how many of these types of thread end up going.
For what it's worth, threads often develop that tone due to people
rejecting the helpful. :-/
dha
--
David H. Adler - <dha@panix.com> - http://www.panix.com/~dha/
I'm occasionally callous and strange. - Willow
------------------------------
Date: 15 Sep 2006 10:37:56 -0700
From: "danparker276@yahoo.com" <danparker276@yahoo.com>
Subject: Re: String buffer instead of file handle?
Message-Id: <1158341876.590183.9480@m73g2000cwd.googlegroups.com>
actually, I just like to cause trouble. It's pretty funny sometimes.
A read the docs post is useless post though, why even post that at all.
David H. Adler wrote:
> On 2006-09-15, Steve K. <spamhole@ntp.isc.org> wrote:
> >
> > For what it's worth, the tone the thread seemed to be moving towards did
> > not seem like it would yield much helpful. Lets just say I've seen this
> > how many of these types of thread end up going.
>
> For what it's worth, threads often develop that tone due to people
> rejecting the helpful. :-/
>
> dha
>
> --
> David H. Adler - <dha@panix.com> - http://www.panix.com/~dha/
> I'm occasionally callous and strange. - Willow
------------------------------
Date: Fri, 15 Sep 2006 13:58:34 -0400
From: Uri Guttman <uri@stemsystems.com>
Subject: Re: String buffer instead of file handle?
Message-Id: <x74pv92er9.fsf@mail.sysarch.com>
>>>>> "dc" == danparker276@yahoo com <danparker276@yahoo.com> writes:
dc> actually, I just like to cause trouble. It's pretty funny sometimes.
dc> A read the docs post is useless post though, why even post that at all.
cause smart people (unlike you) actually will go read the referenced
doc. it is useful but you wouldn't know that. now please go learn python
and try to be funny there. they appreciate people like you.
and stop top posting. but better yet, stop posting here. we are tired of
you and you were never entertaining.
uri
--
Uri Guttman ------ uri@stemsystems.com -------- http://www.stemsystems.com
--Perl Consulting, Stem Development, Systems Architecture, Design and Coding-
Search or Offer Perl Jobs ---------------------------- http://jobs.perl.org
------------------------------
Date: Thu, 14 Sep 2006 23:40:30 +0200
From: "Dr.Ruud" <rvtol+news@isolution.nl>
Subject: Re: username passwd expect
Message-Id: <eecpci.q4.1@news.isolution.nl>
John Bokma schreef:
> Dr.Ruud:
>> john f5q*d&7d
>
> Thanks, now I have to change my password :-(
That won't be possible before next week because all copies of the old
forms are shredded now, which took us the best of the past two weeks,
including evenings and weekends, and we are not allowed to use the new
forms yet because the logo is done wrong again.
--
Affijn, Ruud
"Gewoon is een tijger."
------------------------------
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 9729
***************************************