Live data from Hacker News

Perl 5.20.0 released

metacpan.org

11–20 of 85 posts

Re: Perl 5.20.0 released

#11
For those who do not wish to read the entire changelog, the two important changes are these:

    Subroutine Signatures

    sub foo ($left, $right) {
        return $left + $right;
    }
https://metacpan.org/pod/release/RJBS/perl-5.20.0/pod/perlsu...

    Postfix dereferencing

    $array_ref->@*;
instead of

    @{$array_ref};
https://metacpan.org/pod/release/RJBS/perl-5.20.0/pod/perlde...

Re: Perl 5.20.0 released

#12
post #7
post #4

The biggest change is the move towards deprecating ascii-related functions: Use of any of these functions in the POSIX module is now deprecated: isalnum, isalpha, iscntrl, isdigit, isgraph, islower, isprint, ispunct, isspace, isupper, and isxdigit these are going to be littered throughout most perl code - its definitely in a lot of my code.

subroutine signatures look pretty interesting to me, albeit experimental. https://metacpan.org/pod/release/RJBS/perl-5.20.0/pod/perlsu... edit: and the copy-on-write string concatenating has the potential to speed up a lot of code, I think.

'subroutine signatures' is such a basic and expected feature that it isn't even named in other languages. People just assume "it has to be there"...

This is what makes people run way from Perl nowadays. I recently tried to convince someone that Perl is superior to PHP. When he saw the sub and $_ and shift he was like "I'm not touching this with a ten foot pole".

And there was nothing I could say. Compared to something like PHP 5.4, Perl looks like "mildly evolved stone age shell scripting with some chinese characters in it".

And I say this saddened because I still wish PHP wouldn't have won the "battle for the web" over Perl.

Re: Perl 5.20.0 released

#13
post #3

This deprecation affects things like $\cT, where \cT is a literal control (such as a NAK or NEGATIVE ACKNOWLEDGE character) in the source code. Surprisingly, it appears that originally this was intended as the canonical way of accessing variables like $^T, with the caret form only being added as an alternative. I love perl and use it nigh-unto daily, but—what could possibly have been the thought process behind that?…

As someone with zero Perl experience...is this a joke? People naming variables with literal control characters?!

Re: Perl 5.20.0 released

#14

For those who do not wish to read the entire changelog, the two important changes are these: Subroutine Signatures sub foo ($left, $right) { return $left + $right; } https://metacpan.org/pod/release/RJBS/perl-5.20.0/pod/perlsu... Postfix dereferencing $array_ref->@*; instead of @{$array_ref}; https://metacpan.org/pod/release/RJBS/perl-5.20.0/pod/perlde...

Important to note that postfix dereferencing is experimental, and does not replace the existing method of dereferencing.

Also, I think the deprecation of core CGI.pm is pretty major. For now it just issues a deprecation warning, but will be removed totally from core in future versions, only being available via the CPAN.

https://metacpan.org/pod/release/RJBS/perl-5.20.0/pod/perlde...

Re: Perl 5.20.0 released

#15
post #4

The biggest change is the move towards deprecating ascii-related functions: Use of any of these functions in the POSIX module is now deprecated: isalnum, isalpha, iscntrl, isdigit, isgraph, islower, isprint, ispunct, isspace, isupper, and isxdigit these are going to be littered throughout most perl code - its definitely in a lot of my code.

> these are going to be littered throughout most perl code > - its definitely in a lot of my code Interesting; I've been programming Perl for almost 20 years, and they're not in any of mine!

I read a lot of files of very raw textual data and if the parsed data tastes good, it gets stored in a DB for analysis, if not, kicked out as error.

Its going to be fun watching people who do used the POSIX functions try alternatives. /[A-Za-z]/, I'd like you to meet umlat-u. The POSIX depended on the locale of the installed software which, assuming that's a feature and not a bug (usually its a bug) it'll be interesting to watch people reimplement that "functionality".

This is a fun 13 year old place to start WRT "simple" data verification, not because it exhaustively covers everything, but its watching a noob start from the beginning and hit about ten different roadblocks. There are plenty more of course.

http://www.perlmonks.org/?node_id=66320

Re: Perl 5.20.0 released

#16
post #12
post #7

Earlier quoted context omitted.

subroutine signatures look pretty interesting to me, albeit experimental. https://metacpan.org/pod/release/RJBS/perl-5.20.0/pod/perlsu... edit: and the copy-on-write string concatenating has the potential to speed up a lot of code, I think.

'subroutine signatures' is such a basic and expected feature that it isn't even named in other languages. People just assume "it has to be there"... This is what makes people run way from Perl nowadays. I recently tried to convince someone that Perl is superior to PHP. When he saw the sub and $_ and shift he was like "I'm not touching this with a ten foot pole". And there was nothing I could say. Compared to somethin…

I have to agree.

Perl was an early love of mine.

I was excited when subroutine prototypes came to Perl. Sadly they were almost completly unlike prototypes in any other language and no-one used them.

Subroutine signatures look like another attempt. Sorry but too late.

Re: Perl 5.20.0 released

#17
post #3

This deprecation affects things like $\cT, where \cT is a literal control (such as a NAK or NEGATIVE ACKNOWLEDGE character) in the source code. Surprisingly, it appears that originally this was intended as the canonical way of accessing variables like $^T, with the caret form only being added as an alternative. I love perl and use it nigh-unto daily, but—what could possibly have been the thought process behind that?…

Could be worse!

"Why does Java allow control characters in its identifiers?"

http://stackoverflow.com/questions/4838507/why-does-java-all...

Re: Perl 5.20.0 released

#18
post #12
post #7

Earlier quoted context omitted.

subroutine signatures look pretty interesting to me, albeit experimental. https://metacpan.org/pod/release/RJBS/perl-5.20.0/pod/perlsu... edit: and the copy-on-write string concatenating has the potential to speed up a lot of code, I think.

'subroutine signatures' is such a basic and expected feature that it isn't even named in other languages. People just assume "it has to be there"... This is what makes people run way from Perl nowadays. I recently tried to convince someone that Perl is superior to PHP. When he saw the sub and $_ and shift he was like "I'm not touching this with a ten foot pole". And there was nothing I could say. Compared to somethin…

> 'subroutine signatures' is such a basic and expected feature that it isn't even named in other languages. People just assume "it has to be there"...

That is an understandable, yet still naive statement. In the implementation of signatures one has to make MANY decisions concerning the trade-offs of syntax, available features and performance impacts of signatures. The discussions about what was needed and wanted for those experimental signatures were massive and in no way trivial.

Further, asking a PHP person to evaluate another language is often fruitless, as their lifelihood is usually closely tied to that language; and they are largely unaware of the systemic ailments plagueing PHP, thus unable to draw a useful comparison.

Re: Perl 5.20.0 released

#19
post #3

This deprecation affects things like $\cT, where \cT is a literal control (such as a NAK or NEGATIVE ACKNOWLEDGE character) in the source code. Surprisingly, it appears that originally this was intended as the canonical way of accessing variables like $^T, with the caret form only being added as an alternative. I love perl and use it nigh-unto daily, but—what could possibly have been the thought process behind that?…

As someone with zero Perl experience...is this a joke? People naming variables with literal control characters?!

Yes. Its a running joke WRT general global variables, and they all have a single character synonym. And once you use up the preferred letters, well, stranger things are used.

a C programmer who understands command line argument lists would not even remotely be surprised at the contents of the general variable $0. Its probably more "civilized" to call it $PROGRAM_NAME in your code, but whatever. I don't think this is controversial to alias $PROGRAM_NAME to $0 for anyone civilized aka some minimal C experience.

Perl tends to be consistent. In a similar style, if you insist on implementing a global general variable like $PERL_VERSION which contains a string of pretty much what it sounds like it contains, to keep things consistent all general vars also have a single character synonym, so welcome to $"control-V"

In the "real world" you can write something stupid enough to get yourself fired. This kind of activity probably qualifies unless you have an excellent excuse. Perhaps if you have a complicated if-then statement with numerous clauses and using one individual weird, yet short, variable name allows a debugging programmer to keep the whole control flow in their head instead of scrolling the mess off the screen, then, maybe, its a win. But I wouldn't make a habit of it.

Given that you can pretty much transparently "upgrade" or "downgrade" the code with a simple search and replace its not a major crisis.

A lot of people use Perl::Critic as a Perl "lint" and a lot of those users put large amounts of the perlvars file in the Variables::ProhibitEvilVariables test although the Perl::Critic authors don't by default include them, which many people consider a bug in Perl::Critic but whatever.

Re: Perl 5.20.0 released

#20
post #12

Earlier quoted context omitted.

'subroutine signatures' is such a basic and expected feature that it isn't even named in other languages. People just assume "it has to be there"... This is what makes people run way from Perl nowadays. I recently tried to convince someone that Perl is superior to PHP. When he saw the sub and $_ and shift he was like "I'm not touching this with a ten foot pole". And there was nothing I could say. Compared to somethin…

I have to agree. Perl was an early love of mine. I was excited when subroutine prototypes came to Perl. Sadly they were almost completly unlike prototypes in any other language and no-one used them. Subroutine signatures look like another attempt. Sorry but too late.

You were excited in 1996-Feb-29 when 5.002 was released? Also, prototypes are widely used as syntax hints for the perl compiler and were never meant as signatures.
Post reply on HN