develooper Front page | perl.perl5.porters | Postings from February 2012

Re: [perl #109408] Documentation that refers to Perl 5 as new

Thread Previous | Thread Next
February 1, 2012 06:32
Re: [perl #109408] Documentation that refers to Perl 5 as new
Message ID:
On Tue, Jan 31, 2012 at 08:27:02PM -0700, Tom Christiansen wrote:

> =item *
> Perl pattern matching uses Unicode rules for case-insensitivity, but Python
> uses only ASCII casefolding rules, but Perl uses Unicode casefolding rules,
> so (for example) all three Greek sigmas match case-insensitively in Perl.

I cannot make head nor tails out of this sentence. It starts of with
Perl's ability to do case insensitive Unicode matching, contrasts that
with casefolding in Python, then contrast that with Unicode casefolding
in Perl. Too many "but"s to my taste, and IMO, you should either mention
casefolding three times, or case-insensitivity three times.

> =item * 
> Not all functions need be methods in Perl.

"need to be"?

> =item * 
> A Java C<char> is not an abstract Unicode code point; it is a UTF-16 code
> unit, which means it takes two of Java C<char>s, and special coding, to work
> outside the Basic Multilingual Plane in Java.  In contrast, a Perl character
> I<is> an abstract code point, whose underlying implementation is
> intentionally hidden from the programmer.  Perl code automatically works 
> on the full range of Unicode—and beyond.

Well, I grant you that the intent was to hide it from the programmer.
Unfortunally, in practise, the implementation is often exposed to the

> =item * 
> Perl supports pass by named parameter, allowing optional arguments to be omitted 
> and the argument order freely rearranged.

There's support in Perl for named parameters other than that Perl doesn't
prevent the programmer from rolling their own named parameter support?

> =item * 
> Perl’s garbage collection system is based on reference counting, so it is possible
> to write a destructor to automatically clean up resources like open file descriptors,
> database connections, file locks, etc.

I don't see why reference counting is neccessary to be able to write
destructors to clean up resources. It's true that Perl uses reference
counting, and that it's possible to write such a destructor, but I don't
see the connection.

> =item * 
> Perl regexes don’t need extra backslashes.
> =item * 
> Perl has regex literals, which the compiler compiles and syntax checks them at
> compile time, and stores for efficiency. 

Hmmm. The efficiency is only there if you use them in such a way that it cuts
down on compilation. It's very easy to get this wrong:

    my $re = qr {PAT};
    $str =~ /^$re/;    # Two compilations.

    my $re = qq {PAT};
    $str =~ /^$re/;    # One compilation.

Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About