Live data from Hacker News

Perl is 26 Today

modernperlbooks.com

171–180 of 194 posts

Re: Perl is 26 Today

#171
post #64
post #23

Earlier quoted context omitted.

Interesting. What does Python make harder? In Perl I find myself missing list comprehensions, shared-by-default threading, a well-integrated object system, and a comprehensive, integrated, popular web framework. (Also a standard way of doing event-driven programming, but that's a fair criticism of Python too). And while I'm sure the tooling functionality is there, everything just seems less obvious and standard (e.g.…

There will most likely never be an integrated web framework [0] or a standard way of event-driven programming. There's more than one way. I think Perlbrew [1] is closest to virtualenv. [0] But there is Mojolicious, Dancer, Catalyst, etc [1] http://perlbrew.pl/

I've been liking plenv [1] better than perlbrew. plenv + carton [2] is very nice (comparable to ruby's rbenv and bundler).

[1] https://github.com/tokuhirom/plenv

[2] http://search.cpan.org/perldoc?Carton

Re: Perl is 26 Today

#172

Earlier quoted context omitted.

Unfortunately -- and this is one of the many "banana peels" in Perl 5 -- even a simple statement like print x if x > 5 is problematic in p5 for a whole bunch of reasons: (1) At a bare minimum, what you really need to say is: print "$x\n" if $x > 5; That extra "\n" is a definite turn-off to a lot of people when the get their very first look at Perl. Really, the default these days should be more "say"-like. Of course,…

This is because it is by no means obvious as to which of the more "active" parts of the original expression Isn't it? If someone told you, really you to do just that, would you actually have a problem carrying out that command given a way to print something, a container, and a value to check against the container contents? Also, here's me preference: say $x if $x and $x > 5; Need to catch zero? say $x if defined $x a…

BTW, as to your latter construct:

    say $x if defined $x and $x == 0;
Ya know, it'd be nicer if Perl 5 just had more sensible semantics to this whole "undef" business. For one thing, it's inherently confusing to conflate the semantics of "none of the above" with "not yet scoped". These are two entirely different states of being, yet this is exactly what Perl 5 does.

Really, something like None (as in Python), or Nil as in Perl 6 works a whole lot better. And whatever your magical "none of the above" symbol is called, it really should be == to anything else besides itself. Don't know about you, but

    $x = undef;
    print "boo!\n" if $x == 0;
    # boo!
smells way too much like PHP for my tastes.

Granted, Perl 5 was truly revolutionary in its time, and provided way better semantics for this particular corner case than any of its contemporaries. But it's 2013 and sadly, we know a whole lot better now.

Re: Perl is 26 Today

#173

Earlier quoted context omitted.

This is because it is by no means obvious as to which of the more "active" parts of the original expression Isn't it? If someone told you, really you to do just that, would you actually have a problem carrying out that command given a way to print something, a container, and a value to check against the container contents? Also, here's me preference: say $x if $x and $x > 5; Need to catch zero? say $x if defined $x a…

If someone told you, really you to do just that, The problem here is that's just one way (in linguistics: "voice") in which the statement can be parsed. Another way is to look at it mathematically: print where expr := x if x > 5 which of course has an entirely different meaning. What compounds the difficulty is that in general it's really difficult to anticipate all of these syntactical corner cases through a careful…

You mean this, from the perlsyn man page?

   Statement Modifiers
       Any simple statement may optionally be followed by a SINGLE modifier, just before the terminating semicolon (or block ending).  The possible modifiers are:

           if EXPR
           unless EXPR
           while EXPR
           until EXPR
           when EXPR
           for LIST
           foreach LIST
There are rules for how loosely and tightly different operators bind. Read the docs, and your questions will be answered. Ignoring the documentation does not make for a good argument.

Re: Perl is 26 Today

#174
post #13

I recently turned into a Perl user. Though I must say, documentation about Perl with CGI, and pre-made scripts are a let down. I browsed many O-Reilly books on Perl, CGI is one of the least explanative topics. Some modules have very obscure explanation on CPAN, I don't mean any offense. If not for Perl Monks, my enthusiasm might have been lost midway.

CGI is not the way to go today. If you want to build web pages with Perl, check out http://mojolicio.us

Depends on what you are doing and how much traffic you have and what web server you're sitting behind.

For example: emacsformacosx.com was straight Perl CGI until about 2 weeks ago.

Re: Perl is 26 Today

#175

Earlier quoted context omitted.

Unfortunately -- and this is one of the many "banana peels" in Perl 5 -- even a simple statement like print x if x > 5 is problematic in p5 for a whole bunch of reasons: (1) At a bare minimum, what you really need to say is: print "$x\n" if $x > 5; That extra "\n" is a definite turn-off to a lot of people when the get their very first look at Perl. Really, the default these days should be more "say"-like. Of course,…

This is because it is by no means obvious as to which of the more "active" parts of the original expression Isn't it? If someone told you, really you to do just that, would you actually have a problem carrying out that command given a way to print something, a container, and a value to check against the container contents? Also, here's me preference: say $x if $x and $x > 5; Need to catch zero? say $x if defined $x a…

[deleted]

Re: Perl is 26 Today

#176
post #35

Earlier quoted context omitted.

I wouldn't have had a job between 2003-2004 which was untangling Perl and rewriting it in C# :)

Are there any new Perl jobs in 2014? Is there growth in the actual number of Perl full-time positions or is it declining? Companies obviously need Perl programmers to maintain and enhance existing systems, but we don't see or hear about any new start-ups using Perl as part of their stack. Fwiw: I don't use Perl anymore but was a fan and love Moose and CPAN.

We're a growth stage startup hiring perl programmers to do new development in the Los Angeles area. Perl isn't the only language we use (we have some python), but it's widely used throughout our systems.

https://www.ziprecruiter.com/hiring

Re: Perl is 26 Today

#177

Earlier quoted context omitted.

I first looked at perl last week and also shared your sentiment. At first when I saw perl I was aghast. The "ugly" $%@ syntax seemed pointless and unreadable. Then I decided to take a look at a non-beginner book, Intermediate Perl http://it-ebooks.info/book/879/ . I was surprised and excited 50 pages in because I realized that Perl had a wealth of tricks , and that that "ugly" $%@ syntax actually had some cool reperc…

Unfortunately -- and this is one of the many "banana peels" in Perl 5 -- even a simple statement like print x if x > 5 is problematic in p5 for a whole bunch of reasons: (1) At a bare minimum, what you really need to say is: print "$x\n" if $x > 5; That extra "\n" is a definite turn-off to a lot of people when the get their very first look at Perl. Really, the default these days should be more "say"-like. Of course,…

Not knowing where uninitialized things can occur and prefer to put check for defined in every "if" is not the attitude to programming I'd support. Most of the parts of the code should operate on expected content. Undefinedness is very convenient but it is typically handled on the points where it matters, e.g. when you can not find the element in the hash, for example.

Re: Perl is 26 Today

#178
post #167

Earlier quoted context omitted.

You wanted me to come up with a scenario like gaming graphics pipelines in a discussion of Perl, a language primarily used for Unix scripting tasks? OK.

I just told you that i exactly did not want you do to that: > I was hoping to get you to be creative and come up with your own problem/solution pairs. :) Also: http://www.youtube.com/watch?feature=player_detailpage&v=R5F... https://dl.dropboxusercontent.com/u/10190786/your_perl_on_dr... Both done in realtime in Perl. Also, oh god, all that stuff you edited into the reply before that one about LARTing and whatever, yo…

>>> I was hoping to get you to be creative and come up with your own problem/solution pairs.

>> You wanted me to come up with a scenario like gaming graphics pipelines in a discussion of Perl, a language primarily used for Unix scripting tasks?

> I just told you that i exactly did not want you do to that: "I was hoping to get you to be creative and come up with your own problem/solution pairs."

Christ.

Re: Perl is 26 Today

#179
post #178

Earlier quoted context omitted.

I just told you that i exactly did not want you do to that: > I was hoping to get you to be creative and come up with your own problem/solution pairs. :) Also: http://www.youtube.com/watch?feature=player_detailpage&v=R5F... https://dl.dropboxusercontent.com/u/10190786/your_perl_on_dr... Both done in realtime in Perl. Also, oh god, all that stuff you edited into the reply before that one about LARTing and whatever, yo…

>>> I was hoping to get you to be creative and come up with your own problem/solution pairs. >> You wanted me to come up with a scenario like gaming graphics pipelines in a discussion of Perl, a language primarily used for Unix scripting tasks? > I just told you that i exactly did not want you do to that: "I was hoping to get you to be creative and come up with your own problem/solution pairs." Christ.

I'm sorry, i don't know what's upsetting you. What i said originally and how you interpreted it are simply entirely different things.

Re: Perl is 26 Today

#180

Earlier quoted context omitted.

If someone told you, really you to do just that, The problem here is that's just one way (in linguistics: "voice") in which the statement can be parsed. Another way is to look at it mathematically: print where expr := x if x > 5 which of course has an entirely different meaning. What compounds the difficulty is that in general it's really difficult to anticipate all of these syntactical corner cases through a careful…

You mean this, from the perlsyn man page? Statement Modifiers Any simple statement may optionally be followed by a SINGLE modifier, just before the terminating semicolon (or block ending). The possible modifiers are: if EXPR unless EXPR while EXPR until EXPR when EXPR for LIST foreach LIST There are rules for how loosely and tightly different operators bind. Read the docs, and your questions will be answered. Ignorin…

The point is that in any well designed product you shouldn't have to study the docs (all that much) in order to start being productive. And there should be as few "gotchas" as humanely possible please. Did I say pretty please?

This has been observed with countless other technologies -- JavaScript, MySQL, MongoDB, etc. Long-time Perl hackers tend to forget their first experiences with the languages (which for many with languages with far worse track records on the consistency / simplicity scale). But newer users have (rightfully) come to expect much better.

And interestingly: the very use case that started this whole thread

    statement IF
isn't in your excerpt, above. Which means that new users are most likely to encounter it "experimentally", i.e. while debugging someone else's convoluted while/unless/last/goto loop.

Of course, it's not that hard to "figure out." Implicitly, it refers to the issue of precedence, which is presumably detailed, uh, somewhere else. Which means a new user to the language has to either spend more pillow time reading, or more hair-pulling time watching their programs blow up unexpectantly before they "get the hang of it."

Which has a lot to do with why newer programmers just aren't turning to Perl as much, these days.

Post reply on HN