[32108] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 3372 Volume: 11

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon May 2 11:09:26 2011

Date: Mon, 2 May 2011 08:09: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           Mon, 2 May 2011     Volume: 11 Number: 3372

Today's topics:
    Re: Books on C/C++ for perl programmers <cartercc@gmail.com>
    Re: character classes, locale and utf8 - strange behavi <hjp-usenet2@hjp.at>
    Re: Perl Compiler <hjp-usenet2@hjp.at>
    Re: Perl Compiler <nospam.gravitalsun@hotmail.com.nospam>
    Re: time has come to end posting of "posting guidelines <Groleau+news@FreeShell.org>
    Re: time has come to end posting of "posting guidelines <sherm.pendley@gmail.com>
    Re: Why print doesn't print anything in the debug mode? <heiko@hexco.de>
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

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

Date: Mon, 2 May 2011 06:38:27 -0700 (PDT)
From: ccc31807 <cartercc@gmail.com>
Subject: Re: Books on C/C++ for perl programmers
Message-Id: <50cfe609-40f7-4d25-81bc-d2516ad88b0a@p19g2000yqh.googlegroups.com>

On Apr 29, 3:54=A0pm, John Bokma <j...@castleamber.com> wrote:
>
> > 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?

Have you ever tried to write write Scala or Clojure? Both use the JVM,
and the compile/run cycle is a nightmare. If you don't know better, it
might be acceptable, but if you are used to the Lisp compile/run
cycle, it's gut-wrenching.

This probably isn't a fair test, but it's my experience.

CC.


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

Date: Sat, 30 Apr 2011 11:07:03 +0200
From: "Peter J. Holzer" <hjp-usenet2@hjp.at>
Subject: Re: character classes, locale and utf8 - strange behaviour
Message-Id: <slrnirnk9o.6gg.hjp-usenet2@hrunkner.hjp.at>

On 2011-04-29 12:56, Michal Jankowski <michalj@fuw.edu.pl> wrote:
> 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).

You are testing characters of a Perl character string (also known as a
wide string or utf8 string, although the latter term is misleading).
Each character is - drum roll - a character. It is not an octet or
integer of undefined semantics. Thus "ó" (U+00F3) is always a "LATIN
SMALL LETTER O WITH ACUTE" and µ (U+00B5) is always a "MICRO SIGN" (and
incidentally, "μ" (U+03BC) is a GREEK SMALL LETTER MU). The Unicode
standard unambiguosly assigns properties such as "lower case letter" to
each character (or code point). These are independent of the current
locale.  So it is not surprising that these characters are recognized as
word characters even if no locale is in effect.

(In the Unix locale system, the default locale ("C" or "POSIX")
generally doesn't recognize them, because it assumes US-ASCII as the
lowest common denominator - octets of value above 0x7F have no defined
meaning. But this doesn't apply to Perl character strings)


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

This is indeed surprising and probably a bug. According to perldoc
perlre, [:word:] and \w are supposed to be equivalent.

	hp



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

Date: Sat, 30 Apr 2011 11:11:20 +0200
From: "Peter J. Holzer" <hjp-usenet2@hjp.at>
Subject: Re: Perl Compiler
Message-Id: <slrnirnkho.6gg.hjp-usenet2@hrunkner.hjp.at>

On 2011-04-30 07:28, Anonymous <nobody@remailer.paranoici.org> wrote:
> Is it possible to compile perl

No, not in the sense you probably mean.

> and obtain an exe file?

Yes.

> Running the script is a problem simple because I don't know
> the path of the perl interpreter of the person running it.

Take a look at PAR.

	hp


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

Date: Mon, 2 May 2011 10:31:42 +0300
From: "George Mpouras" <nospam.gravitalsun@hotmail.com.nospam>
Subject: Re: Perl Compiler
Message-Id: <iplmjf$139i$1@news.ntua.gr>

Give a try to this also

     perlcc
    /usr/bin/perlcc: Usage:
    /usr/bin/perlcc [-o executable] [-r] [-O|-B|-c|-S] [-I /foo] [-L /foo] 
[-log log] [source[.pl] | -e oneliner]

Perlcc is (was) an excellent in my opinion ...



"Anonymous" <nobody@remailer.paranoici.org> wrote in message 
news:81832d8774bf37fc73a185ea539efa00@remailer.paranoici.org...
> Is it possible to compile perl and obtain an exe file?
> Running the script is a problem simple because I don't know
> the path of the perl interpreter of the person running it.
> 




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

Date: Sat, 30 Apr 2011 18:18:14 -0400
From: Wes Groleau <Groleau+news@FreeShell.org>
Subject: Re: time has come to end posting of "posting guidelines" (was FAQ flood  MUST end)
Message-Id: <ipi1r5$a01$4@dont-email.me>

On 04-28-2011 21:31, Jon Du Kim wrote:
> movement. Specifically, the obsolete idea of enforcing certain ideas
> or rules must end. If the perl community is to thrive than this dated
> idea of "posting guidelines" should be officially shunned by this group.

My few experiences with this group suggest that what is shunned
is Larry Wall's advice, i.e.,

    There ain't nothin' in this world worth being a snot about.

-- 
Wes Groleau

   There are two types of people in the world …
   http://Ideas.Lang-Learn.us/barrett?itemid=1157


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

Date: Sat, 30 Apr 2011 14:19:16 -0400
From: Sherm Pendley <sherm.pendley@gmail.com>
Subject: Re: time has come to end posting of "posting guidelines"
Message-Id: <m27habfvq3.fsf@sherm.shermpendley.com>

Jon Du Kim <jondk@FAKE.EMAIL.net> writes:

> Let's discuss this like adults....

First you rant about throwing out the posting guidelines, now you want
to follow them.

Make up your mind!

sherm--

-- 
Sherm Pendley
                                   <http://camelbones.sourceforge.net>
Cocoa Developer


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

Date: 30 Apr 2011 13:55:03 GMT
From: =?iso-8859-2?Q?Heiko_Ei=DFfeldt?= <heiko@hexco.de>
Subject: Re: Why print doesn't print anything in the debug mode?
Message-Id: <4dbc14b6$0$7667$9b4e6d93@newsspool1.arcor-online.net>

Ilya Zakharevich wrote:

> 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

In other words: leave out the 'my'

Heiko
-- 



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

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 3372
***************************************


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