[32107] in Perl-Users-Digest
Perl-Users Digest, Issue: 3371 Volume: 11
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Apr 29 18:09:44 2011
Date: Fri, 29 Apr 2011 15:09:07 -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, 29 Apr 2011 Volume: 11 Number: 3371
Today's topics:
Re: Books on C/C++ for perl programmers <cartercc@gmail.com>
Re: Books on C/C++ for perl programmers <john@castleamber.com>
Re: Books on C/C++ for perl programmers <tadmc@seesig.invalid>
Re: Books on C/C++ for perl programmers <john@castleamber.com>
Re: Books on C/C++ for perl programmers <cartercc@gmail.com>
Re: Books on C/C++ for perl programmers <john@castleamber.com>
character classes, locale and utf8 - strange behaviour <michalj@fuw.edu.pl>
Re: time has come to end posting of "posting guidelines <jurgenex@hotmail.com>
Re: time has come to end posting of "posting guidelines <jondk@FAKE.EMAIL.net>
Why print doesn't print anything in the debug mode? <pengyu.ut@gmail.com>
Re: Why print doesn't print anything in the debug mode? <nospam-abuse@ilyaz.org>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Fri, 29 Apr 2011 06:27:57 -0700 (PDT)
From: ccc31807 <cartercc@gmail.com>
Subject: Re: Books on C/C++ for perl programmers
Message-Id: <943be89d-c814-4d09-87b8-9306785bf33c@k5g2000yqj.googlegroups.com>
On Apr 28, 6:04=A0pm, John Bokma <j...@castleamber.com> wrote:
> Not really, at least if you mean: people are using it so it must be
> useful [1]. I do understand that a lot of people somehow think that way,
> but I don't or at least I try not to. I started with Perl because /I/
> considered it useful (this was before the CGI hype). Of course others
> helped and still help in seeing the light ;-)
Okay, try a thought experiment: take a group of languages that were
developed at about the same time, and figure out why some lived while
most died. Once, Java was just a gleam in James Gosling's eye, now
(judging by the number of published books) it's very popular. Why?
It's because a large number of people found it useful for productive
labor, IOW, it succeeded in the market of programming languages.
> Oh, I do care about the opinions of others, I mean I am sure I got into
> Perl because others mentioned it (can't recall how I exactly got into
> it, tbh). But if I was running with the crowd I probably would be coding
> in PHP right now (and C back then). Or maybe Ruby. I do have books on
> each language (and then some more), but I am actually studying Python
> (besides Perl ;-)), and also currently looking into Emacs Lisp (for
> obvious reasons) and Haskell.
I have been trying to learn Common Lisp for several years, and am now
beginning to rewrite some of my Perl scripts in Lisp. It's simply
AMAZING how little Lisp code will do the same job as a bunch of Perl
code. If you are interested in collaborating on some Lisp stuff, let
me know.
I'm also using emacs, but only for limited purposes. I find vi (vim)
much, much more useful.
> Depends. This week I have several times noticed that if you put two
> people who have half a clue together you don't get the same result as 1
> person with clue. I have even the feeling that the sum of 2 people with
> half a clue is less than half (or even less) a clue.
I have worked with pair programming, using agile techniques, and I can
vouch from personal experience that two people working together can
get a lot more done than the same two people working alone. This isn't
hype, it's simply my experience.
> Anyway, I recommend to learn a language because one wants to. Not
> because others consider it useful / good / perfect. Nor because the most
> jobs available are for that language. Nor would I recommend to ignore a
> language because the crowd considers it "teh suck" (otherwise, why code
> Perl).
I agree, with the caveat that the desire to learn a particular
language comes at least in part from seeing others use the language. I
learned Perl because at the time it was the 'glue of the internet' so
at least in my case the popularity of Perl was the key factor.
CC.
------------------------------
Date: Fri, 29 Apr 2011 11:54:09 -0500
From: John Bokma <john@castleamber.com>
Subject: Re: Books on C/C++ for perl programmers
Message-Id: <877hadj8we.fsf@castleamber.com>
ccc31807 <cartercc@gmail.com> writes:
> On Apr 28, 6:04Â pm, John Bokma <j...@castleamber.com> wrote:
>> Not really, at least if you mean: people are using it so it must be
>> useful [1]. I do understand that a lot of people somehow think that way,
>> but I don't or at least I try not to. I started with Perl because /I/
>> considered it useful (this was before the CGI hype). Of course others
>> helped and still help in seeing the light ;-)
>
> Okay, try a thought experiment: take a group of languages that were
> developed at about the same time, and figure out why some lived while
> most died. Once, Java was just a gleam in James Gosling's eye, now
> (judging by the number of published books) it's very popular. Why?
> It's because a large number of people found it useful for productive
> labor, IOW, it succeeded in the market of programming languages.
And it had nothing to do with the massive marketting of Sun, of course
;-)
But no need for a thought experiment; I am fully aware that a large
number of people just follow something because somehow they have an urge
to follow. On top of that, those people have also a greater urge to piss
on everything in direct competition of what they follow /and/ no problem
to make up all kind of bullshit (and believing it!) about what they
follow, and the direct competition. One of the reasons I am hesitant to
jump on a bandwagon, say A, is that I don't like singing, especially:
A is good, A is perfect, A is the best!!!
And what sucks?
All together now!!!
B!! B sucks, B is evil, B is the work of the devil!!
If you use B you go straight to hell
Even for small things, B doesn't do well!
> I have been trying to learn Common Lisp for several years, and am now
> beginning to rewrite some of my Perl scripts in Lisp. It's simply
> AMAZING how little Lisp code will do the same job as a bunch of Perl
> code. If you are interested in collaborating on some Lisp stuff, let
> me know.
Maybe in the future, sure. I want to look further into Emacs Lisp, and
then who knows.
> I'm also using emacs, but only for limited purposes. I find vi (vim)
> much, much more useful.
Not to start a war (I use both) but in what way?
>> Depends. This week I have several times noticed that if you put two
>> people who have half a clue together you don't get the same result as 1
>> person with clue. I have even the feeling that the sum of 2 people with
>> half a clue is less than half (or even less) a clue.
>
> I have worked with pair programming, using agile techniques, and I can
> vouch from personal experience that two people working together can
> get a lot more done than the same two people working alone. This isn't
> hype, it's simply my experience.
Like I said: depends. And I did pair programming in the 90's. I don't
think it was called agile or anything else, back then. And I do agree it
does make a difference at times. At other times, when it's clear what
has to be done, in my experience, it just works much better if each
writes his/her own code.
>> Anyway, I recommend to learn a language because one wants to. Not
>> because others consider it useful / good / perfect. Nor because the most
>> jobs available are for that language. Nor would I recommend to ignore a
>> language because the crowd considers it "teh suck" (otherwise, why code
>> Perl).
>
> I agree, with the caveat that the desire to learn a particular
> language comes at least in part from seeing others use the language.
Of course. Or reading a book on it. I have here a few books on
programming languages I haven't seen anyone code in, nor have I seen any
code in it. It's just curiosity.
> I learned Perl because at the time it was the 'glue of the internet'
> so at least in my case the popularity of Perl was the key factor.
I learned Java not only because it was hard to not have a peek at it,
but also because it was easy to do some graphic stuff in it (my site has
stil some simple applets :-) ).
--
John Bokma j3b
Blog: http://johnbokma.com/ Facebook: http://www.facebook.com/j.j.j.bokma
Freelance Perl & Python Development: http://castleamber.com/
------------------------------
Date: Fri, 29 Apr 2011 12:57:02 -0500
From: Tad McClellan <tadmc@seesig.invalid>
Subject: Re: Books on C/C++ for perl programmers
Message-Id: <slrnirlumn.6d7.tadmc@tadbox.sbcglobal.net>
John Bokma <john@castleamber.com> wrote:
> I am fully aware that a large
> number of people just follow something because somehow they have an urge
> to follow. On top of that, those people have also a greater urge to piss
> on everything in direct competition of what they follow /and/ no problem
> to make up all kind of bullshit (and believing it!) about what they
> follow, and the direct competition. One of the reasons I am hesitant to
> jump on a bandwagon, say A, is that I don't like singing, especially:
>
>
> A is good, A is perfect, A is the best!!!
> And what sucks?
> All together now!!!
> B!! B sucks, B is evil, B is the work of the devil!!
> If you use B you go straight to hell
> Even for small things, B doesn't do well!
I apply that even within just the Perl language.
Regarding TMTOWTDI,
In Perl there are 9 ways of doing any particular thing,
but 8 of them suck.
:-)
--
Tad McClellan
email: perl -le "print scalar reverse qq/moc.liamg\100cm.j.dat/"
The above message is a Usenet post.
I don't recall having given anyone permission to use it on a Web site.
------------------------------
Date: Fri, 29 Apr 2011 13:19:10 -0500
From: John Bokma <john@castleamber.com>
Subject: Re: Books on C/C++ for perl programmers
Message-Id: <87vcxwq5sx.fsf@castleamber.com>
Tad McClellan <tadmc@seesig.invalid> writes:
> John Bokma <john@castleamber.com> wrote:
>
>> I am fully aware that a large
>> number of people just follow something because somehow they have an urge
>> to follow. On top of that, those people have also a greater urge to piss
>> on everything in direct competition of what they follow /and/ no problem
>> to make up all kind of bullshit (and believing it!) about what they
>> follow, and the direct competition. One of the reasons I am hesitant to
>> jump on a bandwagon, say A, is that I don't like singing, especially:
>>
>>
>> A is good, A is perfect, A is the best!!!
>> And what sucks?
>> All together now!!!
>> B!! B sucks, B is evil, B is the work of the devil!!
>> If you use B you go straight to hell
>> Even for small things, B doesn't do well!
>
>
> I apply that even within just the Perl language.
>
> Regarding TMTOWTDI,
>
> In Perl there are 9 ways of doing any particular thing,
> but 8 of them suck.
>
> :-)
Certainly. I think that once you can tell what sucks within a language,
and give a good explanation of why it sucks, you're no longer a
beginner. I have a high distrust of people who claim that a programming
language is perfect (and more if they tell me it's easy to learn, in a
few days even...)
Perl sucks in a lot of places in many ways. But it very often gets done
what needs to be done in a way I like. I once told a close friend that
Python is to me like my desk: I keep my desk and extremely
organized. People visiting me the first time might think that I just got
the desk (or even that we just moved in), or haven't been working for a
while :-). But Perl is more like the place where I like to relax: some
mess allowed, and if I want to put my feet on the table I can :-).
If Python is close to math, then Perl is close to psychology: people who
use it are somewhat nuts and are consulted by people with problems :-).
--
John Bokma j3b
Blog: http://johnbokma.com/ Facebook: http://www.facebook.com/j.j.j.bokma
Freelance Perl & Python Development: http://castleamber.com/
------------------------------
Date: Fri, 29 Apr 2011 12:22:29 -0700 (PDT)
From: ccc31807 <cartercc@gmail.com>
Subject: Re: Books on C/C++ for perl programmers
Message-Id: <430b5708-2252-4c79-99ca-9007b8d17b0e@l18g2000yqm.googlegroups.com>
On Apr 29, 12:54=A0pm, John Bokma <j...@castleamber.com> wrote:
> > I'm also using emacs, but only for limited purposes. I find vi (vim)
> > much, much more useful.
>
> Not to start a war (I use both) but in what way?
The easy answer is because I'm pretty productive with it. A longer
answer would involve how I work, which gets into habits and
personality. If I had to give an answer in 25 words or less to a
person unfamiliar with either, I would say, 'vi is optimized for
editing speed and nothing else. emacs is optimized for many different
things. Most of the time, I just want to edit, hence vi.'
> I learned Java not only because it was hard to not have a peek at it,
> but also because it was easy to do some graphic stuff in it (my site has
> stil some simple applets :-) ).
A number of years ago, I did a major project in Java, and during the
project, the light bulb lit up. We were doing pair programming, a
multi-threaded application, writing the tests first, the classes
second, and the integration stuff last. I realized that Java was meant
for large projects with many parts and many people working on them. I
haven't written anything in Java for several years, but if I had to do
a large project, it would be my first choice.
Java is a good language, for its niche. So is Perl. Any tool that does
its job well is a joy to use. I even had a brush with Microsoft's CLI-C
++, and felt that Microsoft had done a very good job with it.
I've played with some languages lately that run on the JVM, Scala and
Clojure, and I'm beginning to develop a strong distaste for the JVM.
CC.
------------------------------
Date: Fri, 29 Apr 2011 14:54:35 -0500
From: John Bokma <john@castleamber.com>
Subject: Re: Books on C/C++ for perl programmers
Message-Id: <87wric96kk.fsf@castleamber.com>
ccc31807 <cartercc@gmail.com> writes:
> On Apr 29, 12:54Â pm, John Bokma <j...@castleamber.com> wrote:
>> > I'm also using emacs, but only for limited purposes. I find vi (vim)
>> > much, much more useful.
>>
>> Not to start a war (I use both) but in what way?
>
> The easy answer is because I'm pretty productive with it.
I think that a good programmer can be pretty productive on a type
writer, or even on a piece of paper ;-)
I guess that what you mean by "pretty productive" is that the editor
makes you happy/feel good. At least, that's how I feel about Emacs; I
like how it works, and what it can do. But I don't think I produce more
Perl code or of a better quality compared to using Textpad (which I used
a lot in the past).
> A longer answer would involve how I work, which gets into habits and
> personality. If I had to give an answer in 25 words or less to a
> person unfamiliar with either, I would say, 'vi is optimized for
> editing speed and nothing else. emacs is optimized for many different
> things. Most of the time, I just want to edit, hence vi.'
Does this "many different things" include editing speed? ;-). Anyway, I
think I understand, and that's what I like about Emacs: I can switch to
GNUS and am still in the same program. I want to using Emacs for email
a try (still Thunderbird).
>> I learned Java not only because it was hard to not have a peek at it,
>> but also because it was easy to do some graphic stuff in it (my site has
>> stil some simple applets :-) ).
>
> A number of years ago, I did a major project in Java, and during the
> project, the light bulb lit up. We were doing pair programming, a
> multi-threaded application, writing the tests first, the classes
> second, and the integration stuff last. I realized that Java was meant
> for large projects with many parts and many people working on them. I
> haven't written anything in Java for several years, but if I had to do
> a large project, it would be my first choice.
Yeah, I can see that. Maybe the same here, if Java is an option, of
course. I have somewhat the same feeling about Python, and less about
Perl. Not saying that large projects are not possible in Perl, just that
I have a (vague?) feeling about it ;-)
> Java is a good language, for its niche. So is Perl.
Yup, I think that most languages are OK for their niche. With Perl it's
often OK, most of the times good enough, and at times a joy to use.
> I've played with some languages lately that run on the JVM, Scala and
> Clojure, and I'm beginning to develop a strong distaste for the JVM.
Why?
--
John Bokma j3b
Blog: http://johnbokma.com/ Facebook: http://www.facebook.com/j.j.j.bokma
Freelance Perl & Python Development: http://castleamber.com/
------------------------------
Date: Fri, 29 Apr 2011 14:56:08 +0200
From: Michal Jankowski <michalj@fuw.edu.pl>
Subject: character classes, locale and utf8 - strange behaviour
Message-Id: <kjzpqo5jjx3.fsf@ccfs1.fuw.edu.pl>
This simple program:
----------------------------------------------------------------------
#!/usr/bin/perl -w
use strict;
use utf8;
use open ':utf8', ':std';
my $s = 'abąćłóµ_,.';
for (split('', $s)) {
print "$_ ";
{
no locale;
print /[[:word:]]/? 'T' : 'F', ' ', /\w/? 'T' : 'F', ' ';
}
{
use locale;
print /[[:word:]]/? 'T' : 'F', ' ', /\w/? 'T' : 'F', ' ';
}
{
use locale;
use POSIX;
setlocale(LC_ALL, "C");
print /[[:word:]]/? 'T' : 'F', ' ', /\w/? 'T' : 'F', ' ';
}
print "\n";
}
----------------------------------------------------------------------
Produces the following result:
a T T T T T T
b T T T T T T
Ä… T T T T T T
ć T T T T T T
Å‚ T T T T T T
ó T T T F T F
µ T T T F T F
_ T T T T T T
, F F F F F F
. F F F F F F
----------------------------------------------------------------------
The first surprise is that with a 'no locale' in force non-ascii
accented or Greek characters belong to class [:word:] (or [:alpha:]).
I'd expect [:word:] to be equivalent to [a-zA-Z0-9_] in this case (and
in 'C' locale, too).
The second surprise is that after switching locale on, the classes
[:word:] and \w are no longer equivalent - some characters, notably
"ó", are no longer matched by \w. Seems independent of the actual
locale used (I've tried pl.PL, de.DE, C with identical results). This
clearly looks like a bug to me.
Tested on perl 5.10 (and 5.8).
Any comments?
Michał Jankowski
------------------------------
Date: Fri, 29 Apr 2011 03:48:38 -0700
From: Jürgen Exner <jurgenex@hotmail.com>
Subject: Re: time has come to end posting of "posting guidelines" (was FAQ flood MUST end)
Message-Id: <7c4lr69pir69o5or32cghqsjfrki2f3qea@4ax.com>
>Jon Du Kim wrote:
>
>> Specifically, the obsolete idea of enforcing certain ideas
>> or rules must end.
You mean ideas and rules like offering your seat in the bus to an elder
lady or not parking in a handicaped parking spot or not yakking away on
your cell phone in a movie theater? There was a time when courtesy and
manners went without saying and were valued as the grease that kept
society moving smoothly.
Same applies to Usenet and basic manners in Newsgroups. If you behave
poorly you get a little slap on your fingers. If you keep on behaving
like you grew up in the gutter you will be ostracized. The posting
guidelines are merely an offer or a helping hand to anyone to avoid that
from happening.
jue
------------------------------
Date: Fri, 29 Apr 2011 08:53:59 -0400
From: Jon Du Kim <jondk@FAKE.EMAIL.net>
Subject: Re: time has come to end posting of "posting guidelines"
Message-Id: <f1e49$4dbab4e8$ce534406$32083@news.eurofeeds.com>
Here is a good example:
When my grandparents were children it was common to rub bourbon on the gums
of a teething baby. Today, of course, one does not provide a crying baby
this treatment.
"Posting Guideleines" are as antiquated as the bourbon treatment. A curious
relic of a by-gone time.
> You mean ideas and rules like offering your seat in the bus to an elder
> lady or not parking in a handicaped parking spot or not yakking away on
> your cell phone in a movie theater? There was a time when courtesy and
> manners went without saying and were valued as the grease that kept
> society moving smoothly.
> Same applies to Usenet and basic manners in Newsgroups. If you behave
> poorly you get a little slap on your fingers. If you keep on behaving
> like you grew up in the gutter you will be ostracized. The posting
> guidelines are merely an offer or a helping hand to anyone to avoid that
> from happening.
------------------------------
Date: Fri, 29 Apr 2011 08:18:05 -0700 (PDT)
From: Peng Yu <pengyu.ut@gmail.com>
Subject: Why print doesn't print anything in the debug mode?
Message-Id: <63e4ffdf-4bf1-406e-ab77-a6704b7d6a2d@s16g2000prf.googlegroups.com>
Hi,
perl -d -e 1
I run the above command to start perl in the debug mode. Then I try to
print a variable. But it doesn't print anything. Should I expect
something be printed? Is there anything wrong?
DB<4> my $x=10;
DB<5> print $x;
------------------------------
Date: Fri, 29 Apr 2011 15:39:41 +0000 (UTC)
From: Ilya Zakharevich <nospam-abuse@ilyaz.org>
Subject: Re: Why print doesn't print anything in the debug mode?
Message-Id: <slrnirlmtt.41h.nospam-abuse@chorin.math.berkeley.edu>
On 2011-04-29, Peng Yu <pengyu.ut@gmail.com> wrote:
> Hi,
>
> perl -d -e 1
>
> I run the above command to start perl in the debug mode. Then I try to
> print a variable. But it doesn't print anything. Should I expect
> something be printed? Is there anything wrong?
>
> DB<4> my $x=10;
> DB<5> print $x;
Each typed statement is eval'ed separately. Declarations of lexical
variables do not survive between statements.
Ilya
------------------------------
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:
To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.
Back issues are available via anonymous ftp from
ftp://cil-www.oce.orst.edu/pub/perl/old-digests.
#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 3371
***************************************