Perl, Perl 6, and Two Application Frameworks Release 2017 Advent Calendars (perladvent.org) 38
An anonymous reader writes:
Friday saw this year's first new posts on the Perl Advent Calendar, a geeky tradition first started back in 2000. It describes Santa including Unicode's "Father Christmas" emoji by enabling UTF-8 encoding and then using the appropriate hexadecimal code.
But in another corner of the North Pole, you can also unwrap the Perl 6 Advent Calendar, which this year celebrates the two-year anniversary of the official launch of Perl 6. Its first post follows a Grinch who used the but and does operators in Perl 6, while wrapping methods and subroutines to add extra sneaky features, "and even mutated the language itself to do our bidding."
Perl/Python guru Joel Berger has also started an advent calendar for the Mojolicious web application framework (written in Perl), and there's apparently also an advent calendar coming for the Perl Dancer web application framework.
But in another corner of the North Pole, you can also unwrap the Perl 6 Advent Calendar, which this year celebrates the two-year anniversary of the official launch of Perl 6. Its first post follows a Grinch who used the but and does operators in Perl 6, while wrapping methods and subroutines to add extra sneaky features, "and even mutated the language itself to do our bidding."
Perl/Python guru Joel Berger has also started an advent calendar for the Mojolicious web application framework (written in Perl), and there's apparently also an advent calendar coming for the Perl Dancer web application framework.
Re:Gay Sex (Score:1)
If you weren't retarded you would learn pearl instead of Python & go
-=}BeauHD{=-
Re: (Score:1)
At least it seems like it's getting somewhat decent Unicode support. I remember writing a Perl script to strip out stuff from something because reasons.
Why the awkward $delim_len? Because if the hyphen is a U+ 2013 EN DASH the length is 2. If it's a regular ASCII hyphen it's 1. And the only reason I'm stripping them out is because they cause problems later.
You expect this sort of thing in C because strle
Re: (Score:2)
Why the awkward $delim_len? Because if the hyphen is a U+ 2013 EN DASH the length is 2.
But then it isn't a hyphen.
Decouple your mind from visual representations.
In perl, there are even special functions and methods for handling separators, making it very easy to use any delimiters or set of delimiters you define. The typical way to handle this would be with split and join.
Re: (Score:1)
But then it isn't a hyphen.
Yeah, I changed the variable name when I was bowdlerizing the code. And broke it, because I'm sloppy.
Well but the deeper point is that Perl - at least the version I was using then - didn't properly support UTF-8. length($delim) returned the number of bytes like strlen in C by default.
Meanwhile trying the same thing in Python. All the dashes in my code at EN DASHes which Slashdot won't let me post.
prints 1 as even if foo is a EN DASH.
Mind you, just now I tried this
Re:Perl (Score:5, Informative)
You can see how non automatic it is because slashdot, which is written in Perl, is pretty much guaranteed to corrupt unicode characters in comments even though slashdot is is utf8.
Slashdot had UTF-8 support for a short while a decade or so ago. It was turned back off again, because the perl support was too good, allowing things like right-to-left spaces, which the crowd here naturally pounced on.
Turning it back on is easy enough, but unless someone spends a lot of time hardening the system, it will get abused again.
As for your perl em-dash problem, why do you need to know the length, if it's a separator? Use the built-in functions that can deal with a separator of any length, and you should not have to write specific handling.
Re: Perl (Score:1)
I see people complain about this from time to time, but I dont agree. Perl scripts often process binary data and if you assumed UTF-8 on input and output then it would break things like unzipping compressed data on stdin or streaming it to stdout. The unix tradition perl is built on assumes bytes until you tell it otherwise.
I dont follow python, but Id assume you get the exact opposite problem, needing to turn on binary mode any time your script might need to stream binary data?
Meanwhile, I am rather anno
ACs hate it (Score:3)
Re: (Score:3, Funny)
Re:ACs hate it (Score:5, Insightful)
Re: (Score:3)
Re:ACs hate it (Score:4, Interesting)
"Bad programmers can write bad programs" is a tautology.
No, it isn't. Linguistically there's nothing tautological about "A can B", no matter what the relation between A and B is.
The problem with perl is that it makes it (really) hard for good programmers to make (and MAINTAIN) good programs.
There are many problems with perl, but unless you define what a "good program" is, this is meaningless.
Perl gives programmers more rope than most languages. How they use that rope is up to them.
Re: ACs hate it (Score:1)
I will swear by Perls ability to let me write more features in less time, with test cases and documentation, which is easier to maintain than any other language Ive used extensively (C++, C, Delphi, Java, Javascript, Bash)
Ive done a little Python and a little Ruby, and both were prettier to look at, but the toolchains were not as well developed for general purpose agile tinkering at the time I used them. Its hard to make a fair comparison though without delving as deep into those as ive done with perl.
Re: (Score:2)
You can cut off your foot with a scalpel or a chainsaw - but one of them makes it a lot easier to do accidentally.
With strict discipline a good p
Re: ACs hate it (Score:2, Interesting)
I havenâ(TM)t seen Perl in a long time but canâ(TM)t imagine itâ(TM)s never evolved into something which is basically the same as everything else by now.
I have to admit the reason I donâ(TM)t bother with Python is that so far, most Python code Iâ(TM)ve seen has been Write-Only because just like Perl and PhP, the people writing most of the code in it has been âoeI donâ(TM)t want to learn to program, I just wanna do stuffâ.
In the old days, it was BASIC, Visual Basic, se
Re: (Score:2)
Re: ACs hate it (Score:2)
I'll second that. I once tried to understand what was going on in get_iplayer. It was completely opaque. Regexes can suck my ass. I spent several days trying to figure something out (I don't remember what I was trying to do) to no avail. I ended up giving up. To be fair, I'm not a professional programmer, but I don't often struggle that much with source code. I swear, every time I have trouble like that it's been with perl or with c++ when someone gets creative.
Re: (Score:2)
How to tell if you've been using perl too long (Score:5, Funny)
He obviously stealing Christmas, but ... (Score:2)
Its first post follows a Grinch who used the but and does operators in Perl 6 ...
Perl6, brought to you by PHP (Score:2)
Someone has a good sense of humor. The Perl6 advent calendar is hosted on a Wordpress site.
Re: (Score:2, Redundant)
PHP may be a sloppy language that encourages buggy low-quality work such as Wordpress & modules....but you think anyone actually uses Perl 6 for anything? pfffft, Larry screwed around too long, the world at large has left it behind.
Re: (Score:2)
Perhaps. I haven't had time to mess around with it yet, but I've been meaning to. The problem is Perl6 is a clean break from Perl5, so it is only useful for new projects. If you are working with legacy code, you have to stick with Perl5. And there are also a ton of useful packages that are not yet available for Perl6.
Also, while Larry did screw around a bit, the delay wasn't entirely his fault. There were a few groups writing competing specs/implementations, and rewriting them, before they finally settled o
Re: (Score:2)
It has potential. Perl 6 is full of good ideas, so I started using it for a small project. Don't think of it as perl--it is something new, and it hasn't gained big popularity yet. It's not a new version, it's a new language. If they'd called it P++ instead of Perl 6, it would have been a more accurate description.
Re: (Score:2)
it's too complex when other languages can do the same job with a fifth or less the syntax, Larry and co. went crazy and threw in everything and the kitchen sink
Re: (Score:2)
it's too complex when other languages can do the same job with a fifth or less the syntax, Larry and co. went crazy and threw in everything and the kitchen sink
I have sympathy for that viewpoint, but it's no more complex than C++ (including the two most common libraries), but it does a lot more with less library use and boilerplate. It took me a month to feel comfortable with Perl 6. A lot of that "kitchen sink" stuff is really useful. gather/take iteratively builds data structures. emit/tap is for event handling. Junctions and parallel loops are just plain awesome. But each feature seemed unnecessary until I needed to use it. I'd advise against making a firm judg
Re: (Score:2)
You made me laugh with that, as a former C++ dev you picked the one language that is the extremely pathological case of bad architecture. Using that as example is saying "well georgie the birthday pedo clown here isn't so bad, just look at Jeffery Dahmer who ate his victims"
Re: (Score:2)
We may have different metrics. I chose a language that's highly effective and widely used. Its design obviously isn't bad enough to keep people from using it. I didn't cherry-pick it, either. I could have named Haskell as an example of difficulty and theoretical simplicity hampered by conceptual complexity. I have other complaints about Python, Ruby, and Java, so I wouldn't use them as examples in language comparisons. C# is nice but not syntactically expressive and with a weak class/inheritance model. C++
Perl dying (Score:2)
Perl seems to be dying. Everybody loves bash again now, and python, go, node.js, etc..
A big miss by the Perl community was not getting AWS Lambda support or an AWS module for a long time. Boto ate Perl's lunch.