[29285] in Perl-Users-Digest

home help back first fref pref prev next nref lref last post

Perl-Users Digest, Issue: 529 Volume: 11

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sun Jun 17 18:10:42 2007

Date: Sun, 17 Jun 2007 15:09:05 -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           Sun, 17 Jun 2007     Volume: 11 Number: 529

Today's topics:
    Re: 12 hour clock and offset problem <purlgurl@purlgurl.net>
    Re: 12 hour clock and offset problem (Randal L. Schwartz)
    Re: 12 hour clock and offset problem <purlgurl@purlgurl.net>
    Re: 12 hour clock and offset problem <eflorac@imaginet.fr>
    Re: could XML::Simple handling chinese character? xhoster@gmail.com
    Re: encrypted connection with Mail::Sender? <noreply@gunnar.cc>
    Re: How to motivate the use of Perl? <cwilbur@chromatico.net>
    Re: How to motivate the use of Perl?  cartercc@gmail.com
    Re: How to motivate the use of Perl? xhoster@gmail.com
    Re: pairwise_test <bik.mido@tiscalinet.it>
    Re: perl and  php <stoupa@practisoft.cz>
    Re: perl and  php <eflorac@imaginet.fr>
    Re: perl and php <ts@dionic.net>
    Re: Perl script to identify corrupt mbox messages? <tuxedo@mailinator.net>
    Re: The Modernization of Emacs <twisted0n3@gmail.com>
    Re: tool that does inlining of all used packages ? <bik.mido@tiscalinet.it>
    Re: Which Perl 5 OO extension can be seen as "standard" <bik.mido@tiscalinet.it>
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

----------------------------------------------------------------------

Date: Sun, 17 Jun 2007 11:41:58 -0700
From: Purl Gurl <purlgurl@purlgurl.net>
Subject: Re: 12 hour clock and offset problem
Message-Id: <vJadnTjo_efmHejbnZ2dnUVZ_h-vnZ2d@giganews.com>

Randal L. Schwartz wrote:

> Purl Gurl wrote:

>> You are, again, running into convention problems. Convention is to
>> adjust time by hours, only, to determine a local time.

> Almost correct.  There are, in fact, timezones that vary by non-whole hours,
> and places that use mean solar time instead.

> Take a glance at <http://en.wikipedia.org/wiki/Time_zone>, noting the time
> zones for such places as India, Burma, and the center of Australia.

http://www.ibm.com/support/alerts/us/en/daylightsavingstimealert.html

I recently patched my XP boxes to compensate for this.

Our world should adopt my Choctaw culture system of time keeping.
We do not have hours nor days of the week nor months. All is either
day or night and only two seasons in a year, Summer and Winter.

Our time system is based on right now; all which matters is the present.

However, I am a hypocrite. Although Choctaw, I still pay close
attention to auction ending times on Ebay. A girl needs a lot
of shoes to survive this world of ours.

-- 
Purl Gurl
--
"Then again what can you expect from a fat-assed, champagne swilling,
  half-breed just off the Rez?"
   - Joe Kline


------------------------------

Date: Sun, 17 Jun 2007 11:35:30 -0700
From: merlyn@stonehenge.com (Randal L. Schwartz)
Subject: Re: 12 hour clock and offset problem
Message-Id: <86ir9msa31.fsf@blue.stonehenge.com>

>>>>> "Purl" == Purl Gurl <purlgurl@purlgurl.net> writes:

Purl> I know about a cello. I am a professional cellist. I can make my cello
Purl> weep, scream, cry, laugh and sing in voice which will bring you tears
Purl> to your eyes.

Purl> I sure as heck do not know how to build a cello.

Purl> Should I snap my chubby fingers and magically make all Perl modules
Purl> and all knowledge of Perl modules vanish, almost all Perl "programmers"
Purl> would no longer be able to program in Perl.

Your analogy is flawed, and in fact demonstrates precisely the opposite of
what you intended.

Since you don't know how to build a cello, if somone were to provide you with
blocks of wood, some metal, and even plans for building a cello, you would
not, in any reasonable amount of time, be playing cello music.

Perl modules would be akin to having one box with the cello, another box with
the strings, and a third box with the bow, and all you have to do is snap them
together, and there's your music.

So, without modules would be like having raw wood.  *With* modules, you're
making music.

-- 
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!

-- 
Posted via a free Usenet account from http://www.teranews.com



------------------------------

Date: Sun, 17 Jun 2007 12:34:05 -0700
From: Purl Gurl <purlgurl@purlgurl.net>
Subject: Re: 12 hour clock and offset problem
Message-Id: <OqOdnbUMQfksEejbnZ2dnUVZ_vShnZ2d@giganews.com>

Randal L. Schwartz wrote:

> Purl Gurl wrote:

(snipped and snapped together)

>> I know about a cello. I am a professional cellist. I can make my cello
>> weep, scream, cry, laugh and sing in voice which will bring you tears
>> to your eyes.

>> I sure as heck do not know how to build a cello.

>> Should I snap my chubby fingers and magically make all Perl modules
>> and all knowledge of Perl modules vanish, almost all Perl "programmers"
>> would no longer be able to program in Perl.

> Since you don't know how to build a cello, if somone were to provide you with
> blocks of wood, some metal, and even plans for building a cello, you would
> not, in any reasonable amount of time, be playing cello music.

> Perl modules would be akin to having one box with the cello, another box with
> the strings, and a third box with the bow, and all you have to do is snap them
> together, and there's your music.

What? No duct tape and baling wire? Easy snap together, no challenge there!

You ever try to assemble a child's yard swing set from China, using
Chinese-to-English written instructions? There is a challenge!

> So, without modules would be like having raw wood.  *With* modules, you're
> making music.

I know, I know, all become an instant Beethoven.

Many readers believe I am opposed to module usage. I am not. I use some
modules, now and then. What I oppose is readers not learning how to write
code of their own which performs the function of a module. Through learning
how to "hand code" readers attain a knowledge which enhances their ability
to recognize which module to use, which modules are good and, most important,
when use of a module is actually appropriate.

Decades back, I assembled a Chinese made swing set for our girl. I tossed
those Chinese instructions being of more confusion than help. My husband
taught me a lot about nuts, bolts, construction and such. Without a good
working knowledge of how to "put things together" her swing set would have
turned out looking more a transformer robot high on LSD, not that those
transformers do not already look to be just such.

What I am encouraging is developing a good working knowledge of the
nuts and bolts of Perl, before snapping together a Perl swing set.

-- 
Purl Gurl
--
"Then again what can you expect from a fat-assed, champagne swilling,
  half-breed just off the Rez?"
   - Joe Kline


------------------------------

Date: Sun, 17 Jun 2007 22:07:30 +0200
From: Emmanuel Florac <eflorac@imaginet.fr>
Subject: Re: 12 hour clock and offset problem
Message-Id: <pan.2007.06.17.20.07.28.835743@imaginet.fr>

Le Sun, 17 Jun 2007 10:45:17 -0700, Purl Gurl a écrit :

> 
> Ha! Ha! Your lame claim about reinventing the wheel is a flat tire.

Purl Gurl, you're wonderful, but nonetheless wrong about CPAN and
modules :) 

-- 
Le commissaire : Comment vous appelez-vous?  
Garance : Moi je ne m'appelle jamais, je suis toujours là. J'ai pas
besoin de m'appeler. Mais les autres m'appellent Garance, si ça peut
vous intéresser.
Prévert,"les enfants du Paradis".



------------------------------

Date: 17 Jun 2007 21:01:12 GMT
From: xhoster@gmail.com
Subject: Re: could XML::Simple handling chinese character?
Message-Id: <20070617170115.265$Eu@newsreader.com>

"havel.zhang" <havel.zhang@gmail.com> wrote:
> hi everyone:
>
> I found XML::Simple can not handling chinese character. for example:
> part1.xml:
> <?xml version=3D"1.0" encoding=3D"utf-8"?>
> <config>
>   <user>=BA=CD=C6=BD</user>
>   <passwd>longNails</passwd>
>   <books>
>     <book author=3D"Steinbeck" title=3D"Cannery Row"/>
>     <book author=3D"Faulkner" title=3D"Soldier's Pay"/>
>     <book author=3D"Steinbeck" title=3D"East of Eden"/>
>   </books>
> </config>

Hi Havel,

I'm not sure that the Chinese characters in your post survived their
trip through usenet, so I can't use the above to serve as a realistic test.
Can you post a bit of Perl code (using chr(), for example) which is coded
in ASCII but would, when run, properly create the characters you are trying
to express?

Xho

-- 
-------------------- http://NewsReader.Com/ --------------------
Usenet Newsgroup Service                        $9.95/Month 30GB


------------------------------

Date: Sun, 17 Jun 2007 21:24:44 +0200
From: Gunnar Hjalmarsson <noreply@gunnar.cc>
Subject: Re: encrypted connection with Mail::Sender?
Message-Id: <5dlg97F33v6niU1@mid.individual.net>

Morfys wrote:
> I'm trying to use Mail::Sender to send email using smtp.gmail.com, but
> I get errors related to "StartTLS" when my script doesn't create a
> secure connection to the smtp server.  Is there a way to use
> Mail::Sender to create encrypted connections?

You may want to ask that question at 
http://lists.cpan.org/showlist.cgi?name=beginners where the author of 
Mail::Sender is an active participant.

-- 
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl


------------------------------

Date: 17 Jun 2007 14:48:57 -0400
From: Charlton Wilbur <cwilbur@chromatico.net>
Subject: Re: How to motivate the use of Perl?
Message-Id: <874pl6l8me.fsf@mithril.chromatico.net>

>>>>> "fb" == felix bonkatas <felix.bonkatas@hushmail.com> writes:

    fb> In what domains of web development is Perl preferrable to PHP,
    fb> even when developing from the ground up? 

All of them.

    fb> Are people still using Perl for CGI programming?

Yes.

    f> Is Perl's place primarily in b> the backend?

No.

    fb> What about using Perl for database functions, e.g. in
    fb> conjunction with MySQL?

What about it?  perldoc DBI, perldoc DBIx::Class.

    fb> The thing is, I'm about to teach a course in Perl, to
    fb> beginners who already know a little PHP. I need to get them
    fb> motivated. Also, I need to think of a longer exercise, one
    fb> where Perl's strenghts can be shown and one where one doesn't
    fb> constantly think: Couldn't that be done in PHP?

The only thing I've ever seen clearly demonstrate Perl's superiority
is trying to do a large project in PHP and a large project in Perl.
And even that's not decisive; a good self-disciplined team can make
PHP work acceptably well, and a poor sloppy team won't derive any
benefit from Perl.

The answer to your final question is, of *course* it can be done in
PHP, and for people who don't know Perl and who do know PHP, it will
probably be easier to do it in PHP.  If the students are not
demonstrating their motivation simply by being there, you probably
don't have a chance.

Charlton




-- 
Charlton Wilbur
cwilbur@chromatico.net


------------------------------

Date: Sun, 17 Jun 2007 19:52:13 -0000
From:  cartercc@gmail.com
Subject: Re: How to motivate the use of Perl?
Message-Id: <1182109933.215052.31760@k79g2000hse.googlegroups.com>

On Jun 17, 1:31 pm, felix.bonka...@hushmail.com wrote:
> In what domains of web development is Perl preferrable to PHP, even
> when developing from the ground up? Are people still using Perl for
> CGI programming? Is Perl's place primarily in the backend? What about
> using Perl for database functions, e.g. in conjunction with MySQL?
>
> The thing is, I'm about to teach a course in Perl, to beginners who
> already know a little PHP. I need to get them motivated. Also, I need
> to think of a longer exercise, one where Perl's strenghts can be shown
> and one where one doesn't constantly think: Couldn't that be done in
> PHP?
>
> Note that I don't need to be motivated. I've been using Perl for quite
> some time, for system administration and backend stuff, and a little
> as a programming language for writing PostgreSQL functions and
> triggers. However, I've rarely used it for CGI programming.
>
> - Felix


Depends on the level and motivation. Course Technologies publishes a
Perl/CGI book by Diane Zak. This is a very good book for people who
know HTML, CSS, and JavaScript but need to improve (or acquire)
backend skills. It's suitable for a ten week course. The only real
probelm is that it doesn't get to databases.

New Riders published a book several years ago by Paul Dubois entitled
Perl and MySql. I believe New Riders is out of business, and I don't
know whether this book is still in print. Unfortunately (IMO) it uses
the CGI module to build web pages, which I have found to be worse than
useless since it doesn't play nice with CSS or JavaScript. It's a lot
easier to write your own library routines that do what you want them
to do and incorporate CSS and JavaScript.

CC



------------------------------

Date: 17 Jun 2007 21:12:51 GMT
From: xhoster@gmail.com
Subject: Re: How to motivate the use of Perl?
Message-Id: <20070617171253.540$8C@newsreader.com>

felix.bonkatas@hushmail.com wrote:
> In what domains of web development is Perl preferrable to PHP, even
> when developing from the ground up?

I don't consider Perl to be dirt.  By starting with Perl, I am beginning
substantially above the ground.

> Are people still using Perl for
> CGI programming?

Yes.

> Is Perl's place primarily in the backend?

What does that mean?  Is the front-end "client-side" and everything
that is server-side then "backend"?  Or do you mean something else?

> What about
> using Perl for database functions, e.g. in conjunction with MySQL?

Extensively.

> The thing is, I'm about to teach a course in Perl, to beginners who
> already know a little PHP. I need to get them motivated. Also, I need
> to think of a longer exercise, one where Perl's strenghts can be shown
> and one where one doesn't constantly think: Couldn't that be done in
> PHP?

I think it would be better to use example where it *could* be done in PHP,
just with great difficulty/annoyance.

Xho

-- 
-------------------- http://NewsReader.Com/ --------------------
Usenet Newsgroup Service                        $9.95/Month 30GB


------------------------------

Date: Sun, 17 Jun 2007 22:51:04 +0200
From: Michele Dondi <bik.mido@tiscalinet.it>
Subject: Re: pairwise_test
Message-Id: <qm6b735jpr4hdbnjrqnvob3tsd1idfihjl@4ax.com>

On Sat, 16 Jun 2007 18:03:05 +0200, "Dr.Ruud"
<rvtol+news@isolution.nl> wrote:

># find the index of the first non-equal value for
># two arrays, and within a specific index range:
>  print pairwise_do { $a != $b ? $_ : undef } @x, @y, 2..9;

Maybe useful for other purposes, but in this case, what's the *big*
advantage over List::Util's

  print first { $x[$_] != $y[$_] } 2..9;  # ?

If the range were not explicit... then yes, somewhat more clumsy:

  print first { $x[$_] != $y[$_] } 1..max($#x,$#y);

However what one feels more missing in Perl 5 is probably a way to do
things in a parallel manner on two or more lists. That's what Perl 6
zip operator and new pointy subs are really great for:

  for @x Z @y -> $a, $b { say "<$a> <$b>" if $a !$ $b}

(Don't know 'bout map() & C. - I'm really a baby-Perl-6'er)


Michele
-- 
{$_=pack'B8'x25,unpack'A8'x32,$a^=sub{pop^pop}->(map substr
(($a||=join'',map--$|x$_,(unpack'w',unpack'u','G^<R<Y]*YB='
 .'KYU;*EVH[.FHF2W+#"\Z*5TI/ER<Z`S(G.DZZ9OX0Z')=~/./g)x2,$_,
256),7,249);s/[^\w,]/ /g;$ \=/^J/?$/:"\r";print,redo}#JAPH,


------------------------------

Date: Sun, 17 Jun 2007 20:19:47 +0200
From: "Petr Vileta" <stoupa@practisoft.cz>
Subject: Re: perl and  php
Message-Id: <f53u8h$von$1@ns.felk.cvut.cz>

Emmanuel Florac wrote:
> php is a specialized tool. It's very good for the quick and dirty
> job, and good for the kind of stuff you'll often find on
> thedailywtf.com or codinghorror.com .
> It has a lot of very nasty defaults that are mostly unvisible to the
> beginner and the people without a "real" programming background, that
> will bite you sooner or later :
>
> - helps "bad programming" by mixing up html markup and php logic
Right ;-)

> - many security caveats; nothing similar to the "-T" flag in perl, or
> "use strict", or "use warnings"
In this point you are not right. You can use error_reporting(E_ALL / 
E_STRICT ...)

But in all other points I subscribe with you. I don't like PHP at all too.
-- 

Petr Vileta, Czech republic
(My server rejects all messages from Yahoo and Hotmail. Send me your mail 
from another non-spammer site please.)




------------------------------

Date: Sun, 17 Jun 2007 22:03:17 +0200
From: Emmanuel Florac <eflorac@imaginet.fr>
Subject: Re: perl and  php
Message-Id: <pan.2007.06.17.20.03.17.806627@imaginet.fr>

Le Sun, 17 Jun 2007 20:19:47 +0200, Petr Vileta a écrit :

>> - many security caveats; nothing similar to the "-T" flag in perl, or
>> "use strict", or "use warnings"
> In this point you are not right. You can use error_reporting(E_ALL /
> E_STRICT ...)

Yes, but it's cumbersome and unpractical, and your error messages usually
end up in unsecure place, for instance the browser :) And nothing exists
with the huge security and power of "-T", nothing...

-- 
Sutor ne ultra Crepidam.



------------------------------

Date: Sun, 17 Jun 2007 22:57:54 +0100
From: Tim Southerwood <ts@dionic.net>
Subject: Re: perl and php
Message-Id: <4675ae62$0$642$5a6aecb4@news.aaisp.net.uk>

 krakle@visto.com coughed up some electrons that declared:

>...
> Using a database.

> If you want to use Perl effectively to compete with PHP you have to
> utilize hefty modules and make use of mod_perl.


To be fair, to utilise PHP you need mod_phpX

Or you could run PHP as a CGI, which brings it back on a level footing with
the traditional use of perl. So I believe that neither language has a
disadvantage here.

But ... how do you find DBI.pm unconcise?

Agree about the "hefty module" though - perl is a general scripting
language, and was not targetted at the web. However, using mod_perl, I do
not see the use of hefty modules to be a particular disadvantage.

Cheers

Tim


------------------------------

Date: Sun, 17 Jun 2007 22:59:57 +0200
From: Tuxedo <tuxedo@mailinator.net>
Subject: Re: Perl script to identify corrupt mbox messages?
Message-Id: <f547cd$947$03$1@news.t-online.com>

Tuxedo wrote:

> Petr Vileta wrote:
> 
> > Tuxedo wrote:
> > Waht my Tbird2OE? Helped you? I want to know the result ;-)
> > 
> 
> Sorry, but unfortunately I did not get a chance to test your program,

Correction to above, I've now tested Tbird2OE with the following result: 

All messages which existed in the mbox format were succesfully imported 
into Outlook Express. In thereafter importing and converting the Outlook 
(eml) files back into the combined Mozilla mbox format, all messages were 
restored and show up in the newly created Mozilla index. In other words, 
Tbird2OE effectively repaired the mbox and circumvented whatever problem 
Mozilla, Seamonkey and Thunderbird has to parse an mbox containing certain 
buggy messages, or perhaps inconsistencies in how they were separated. 

Thank's a ton Petr for fixing the problem! I wish you all the best with 
your application, even if my particular purpose is not exactly what 
Tbird2OE was designed for.


------------------------------

Date: Sun, 17 Jun 2007 20:58:10 -0000
From:  Twisted <twisted0n3@gmail.com>
Subject: Re: The Modernization of Emacs
Message-Id: <1182113890.115491.168740@m36g2000hse.googlegroups.com>

On Jun 17, 11:13 am, Xah Lee <x...@xahlee.org> wrote:
[snip]

Whoa. Xah posted something I agree with wholeheartedly. Imagine that.



------------------------------

Date: Sun, 17 Jun 2007 21:15:41 +0200
From: Michele Dondi <bik.mido@tiscalinet.it>
Subject: Re: tool that does inlining of all used packages ?
Message-Id: <f22b73p8k7c2n6u085rpiurbd2130un4nq@4ax.com>

On Sun, 10 Jun 2007 21:53:54 -0000, Yakov <iler.ml@gmail.com> wrote:

>Which tool does inlining of all used packages ?

PAR should do that.


Michele
-- 
{$_=pack'B8'x25,unpack'A8'x32,$a^=sub{pop^pop}->(map substr
(($a||=join'',map--$|x$_,(unpack'w',unpack'u','G^<R<Y]*YB='
 .'KYU;*EVH[.FHF2W+#"\Z*5TI/ER<Z`S(G.DZZ9OX0Z')=~/./g)x2,$_,
256),7,249);s/[^\w,]/ /g;$ \=/^J/?$/:"\r";print,redo}#JAPH,


------------------------------

Date: Sun, 17 Jun 2007 22:21:07 +0200
From: Michele Dondi <bik.mido@tiscalinet.it>
Subject: Re: Which Perl 5 OO extension can be seen as "standard" (defacto, quasi)?
Message-Id: <455b731tmba8q9beis1shuq85vete5tpff@4ax.com>

On Sat, 16 Jun 2007 22:30:09 -0000, Ilias Lazaridis
<ilias@lazaridis.com> wrote:

>I don't feel it gives me  a "basic" or a "primitive' OO support (as I
>can
>use the fundament to build upon)

But it *is* primitive, exactly because of that: but then do not
misunderstand me, I've always been fascinated by the far reaching
consequences of such a simple model. However many feel, and rightly
so, that a more robust, pervasive OO model out of the box in which one
is not forced to build stuff that is also available out of the box in
other languages would be desirable: indeed that's why it's beeing
added to Perl 6.

>I summarize from your writings, the there is no OO extension available
>which could be seen as a standard.
>
>The build-in OO support of Perl5 is the today's standard.

Yes, it is *the* one and only standard. All of the available modules
which give you bells and whistles build upon that. Talking about them,
anyway... how 'bout Moose?!? (It is not meant as Perl-6-OO-model in
Perl 5 but borrows heavily from the former.)

>That's fine for me personally (I alreay enjoy the freedom).

Freedom is fine and all, but don't exaggerate. We recommand daily to
restrict one's own freedom in a useful manner that will help one to
prevent making common programming errors, by using strict and
warnings: with OO programming the situation is different and for the
few things I've ever really needed in that field I also followed the
DIY way, but... well, as a principle a better world should be
possible!  ;-)


Michele
-- 
{$_=pack'B8'x25,unpack'A8'x32,$a^=sub{pop^pop}->(map substr
(($a||=join'',map--$|x$_,(unpack'w',unpack'u','G^<R<Y]*YB='
 .'KYU;*EVH[.FHF2W+#"\Z*5TI/ER<Z`S(G.DZZ9OX0Z')=~/./g)x2,$_,
256),7,249);s/[^\w,]/ /g;$ \=/^J/?$/:"\r";print,redo}#JAPH,


------------------------------

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 V11 Issue 529
**************************************


home help back first fref pref prev next nref lref last post