Mojolicious 2.0: Modern Perl For the Web 132
Kvorg writes "After a year of rapid development, newly released version 2.0 of Mojolicious, the new generation real-time Perl web framework written by Sebastian Riedel and many others, offers a versatile and elegant web framework that is as good at web scraping and simple scripts as it is at building complex, interactive real-time applications with HTML5 and websockets. It supports easy 0-dependency installs, excellent developer mode, multiple deployment scenarios, many CPAN modules and plugins."
Syntax (Score:2)
But is it prettier than regular Perl?
Re: (Score:1)
It's very pretty. Look on the homepage to see an example.
Yet Another (Score:3)
Re:Yet Another (Score:4, Insightful)
Because clearly what we need is _yet another_ way to develop web applications.
Frankly, yes. As long as we're advancing and improving, yeah, it always makes sense to keep trying new approaches. I'm using Mojolicious for two apps currently in development. One of them was already in progress using other modules, bit with the Mojolicious::Lite module, I was able to cut my code base nearly in half.
I'll tell you what - why don't.you try it first, then complain about it if you still don't like it.
Re: (Score:2)
Because clearly what we need is _yet another_ way to develop web applications.
Well, why not?
Doesn't matter to the end users what language was used for the back-end, and some programmers will be more familiar or comfortable with Perl. Maybe you don't need this, and I personally have no intention of using it, but some people might find it interesting.
Re: (Score:2)
I still can't figure out how it's actually called. If it lets you use mod_perl then it has a reason to exist. But it probably doesn't.
Re: (Score:2)
Mojo runs on PSGI, like most new generation web frameworks for perl. Its similar to WSGI (Python).
There's some really cool stuff happening in the PSGI world. Check out Plack [plackperl.org].
Re:Yet Another (Score:5, Informative)
sudo sh -c "curl -L cpanmin.us | perl - Mojolicious"
And three lines can make a complete "hello world" application....
use Mojolicious::Lite;
get '/' => {text => 'Hello World!'};
app->start;
Part of what make Mojolicous so powerful is Perl's syntax and expressiveness. I know it's hip to beat up on Perl these days, but perl is still way ahead of most languages in its ability to be expressive. The author of Mojolicous is a really good programmer and insanely picky about well structured code, consistency and test driven development. Hence, the framework is very easy to use and understand. This framework is definitely worth a look.
Re: (Score:2)
OIC. Well that is nifty I guess, although frankly, I would prefer something that I could use with Apache, because I already use Apache, and nonstandard ports suck. I guess if you're doing anything real you can probably dedicate a box.
Re: (Score:2)
Okay then.
$ curl -L cpanmin.us > poison_pill.txt
$ vi poison_pill.txt
Voila.
Re: (Score:3)
I know it's hip to beat up on Perl these days, but perl is still way ahead of most languages in its ability to be expressive.
But far behind the languages that it's competing with in this space. There's a reason why literally ever Perl programmer I know has migrated to Ruby or Python.
I'd much rather write a web app in Perl than C or Pascal. And by roughly the same margin, I'd much rather write the same app on Rails or Django or Pyramid.
Re: (Score:2)
God help you if you ever have to use an OS with a package manager...
Re: (Score:2)
Perl is the most refreshing programming language (Score:5, Funny)
Every time I look at a script I've written that's at least a year old, it's like the first time I've ever seen the code.
Re: (Score:2)
So true! Even if you use strict;, apply liberal comments, and avoid $_ and @_ whenever possible.
Re:Perl is the most refreshing programming languag (Score:5, Informative)
Don't avoid $_ and @_; use them when they are useful, even in implicit form. Perhaps especially in explicit form.
What's more elegant?
or
or
I have seen far too much misguided code of the first and second type.
Have the comments explain what the purpose of the code is, not how it does it. The way to fix perl code isn't to read and understand the actual code, but replace the part that doesn't work as expected with code that does. If you understand your comment and know how to write perl, you don't really need to understand how a cryptic line does something - it's faster to rewrite it from scratch to do what you want.
Assumptions (Score:5, Insightful)
If you understand your comment and know how to write perl, you don't really need to understand how a cryptic line does something - it's faster to rewrite it from scratch to do what you want.
That assumes that the comment correctly describes what the code intends to do. This is a very big assumption to make and I've worked on numerous projects where the comments were significantly different from what the code did. Looking through the change logs, this situation always arises because someone updated the code but didn't bother to update the comments.
This brings me to my point: The code doesn't lie.
If you can't understand a piece of code, you're going to be working off assumptions. Refactoring code based on assumptions is dangerous unless you have very rigorous unit tests. I've found that the level of code obfuscation is negatively correlated with the quality (or even presence!) of unit tests. YMMV.
Re: (Score:3)
What's more elegant?
(or mystring = mystring.rstrip('\r\n') if you're pedantic about only removing EOL chars)
Re: (Score:2)
Re: (Score:3)
Indeed. While it's slower than "chomp while chomp", it doesn't depend on $/ being set correctly.
(If you can rely on $/, and you golf, s-$/+$-- is even shorter)
Re: (Score:2)
apply liberal comments
Don't do it - liberal comments always lie! Comment conservatively instead. ~
Wasn't that supposed to be Ruby? (Score:3, Interesting)
Not to take anything away from this framework, but now I'm curious since at first I took the post title too literally. Wasn't Ruby supposed to be modern Perl for the web? Whatever happened to that? People get bored? Web developer ADHD?
Re: (Score:1)
Re: (Score:1)
Re: (Score:1, Interesting)
Hard to do serious web apps in a language that can't even handle the basics of unicode.
And once you got past scaffolding, rails turned out to be a toy MVC framework that 1) monkeypatches base classes and breaks other libraries, 2) has a toy ORM that can't generate joins properly, and 3) has a template language that basically amounts to script-in-page.
Re: (Score:3)
Sounds like you haven't touched Rails in 10 years. It handles unicode extremely well now, arguably better than any other framework out there, and even has an extended set of localization options that are way more accessible than probably anything else. As for your other arguments:
1. Monkey patching is dangerous in any language - luckily with modern Rails there is significantly less need for it and it's generally discouraged
2. ?? Sounds like you were doing something wrong
3. You don't understand what the C in
Re: (Score:2)
Sounds like you haven't touched Rails in 10 years. It handles unicode extremely well now, arguably better than any other framework out there,
I invite you to consult Unicode: Good, Bad, Ugly [98.245.80.27] and then make that statement again. Full disclosure: Yes, it was written by a Perl guy, but I've not seen any dispute about the facts.
Re: (Score:2)
Yeah, read slide #26, 27, 28 - note how they basically point out Ruby deals with real world situations pretty damn nimbly. Just because you don't understand how the Ruby Unicode system works doesn't mean it's bad. The comment about "han unification" in the slides is proof whoever wrote those slides has idealogical issues that totally don't take into account the reality - probably because he doesn't deal with CJK and thusly doesn't understand its necessity. As someone who deals with multi-locale Ruby code (
Re: (Score:2)
Comparing frameworks in terms of Unicode handling is not all there is to it, because a thing like that really needs to be either in the language or in the core library. Otherwise, even if your-favorite-framework handles it fine, my-absolutely-necessary-library (that I want to use alongside your-favorite-framework) might not. In that sense, Unicode support in Ruby 1.8 could be concisely summed up as "no such thing".
Ruby 1.9 is interesting. On one hand I can buy the argument that CJK and other non-Unicode, no
Re: (Score:2)
The rest of us will likely stick to tools that let us skip the whole mess, like, well, Python 3 or Perl.
I just stick
# encoding: UTF-8
at the top of my Ruby files and handle everything in UTF-8. If it breaks for some Japanese people because they have some stupid religious objection to Unicode, that's their problem. You don't have to pander to them to use Ruby, so it's no reason to abandon Ruby.
Re: (Score:2)
That would guarantee that all strings that come from string literals in your source files are in UTF-8. It doesn't guarantee anything about strings that come from elsewhere - e.g. from the standard library, or from any third-party library you might be using.
You can ignore such libraries that don't provide you the expected encodings, sure. The problem is when you write your own Ruby library that's supposed to be reusable. Now you have to make a decision on whether you want to enforce your choice on the clien
Re: (Score:2)
Actually declaring # encoding: UTF-8 does not assume external libraries are in UTF-8, Ruby handles that pretty well and that's likely because a lot of older Ruby code was written with Shift-JIS. To be honest I've only dealt with non-UTF-8 encodings in Shift-JIS so maybe it only handles those, but I can tell you it works fine and give you a working sample to prove it.
"I wish Ruby wasn't written by a Japanese guy - we wouldn't even have to argue about this by now if it were different..." - I don't even know h
Re: (Score:2)
Actually declaring # encoding: UTF-8 does not assume external libraries are in UTF-8
That's precisely what I wrote. GP's point was that people assume that in practice, though, and he's right.
"I wish Ruby wasn't written by a Japanese guy - we wouldn't even have to argue about this by now if it were different..." - I don't even know how to take that. Seriously.
Take it exactly how it's written. It's not exactly a secret that pretty much the only ones who have serious trouble with Han unification in Unicode - and, as a consequence, Unicode itself - are speakers of Japanase; and the reasons for rejection are most accurately described as "political". It's also not a coincidence that, of all languages and frameworks that acquired encoding awareness, the one that's
Re: (Score:2)
"If it breaks for some Japanese people because they have some stupid religious objection to Unicode" - it doesn't break it, it works very very well and is a very practical real world implementation. But "practical" and "real world" mean engl-euro centric non CJK people want to do things like use a base "n" character and put "~" on top of it with an extended character and make every character 32bit instead of actually being sane and just using efficient standards like UTF-8.
If I'm not mistaken one of the rea
Re: (Score:1)
That's pretty outdated, although I see where it's come from. Most of the issues arise from the old versions on Ruby in use - the ones with shoddy Unicode support, and which require patching of the base classes to gain useful functionality.
The ORM can now be swapped out (and new versions of ActiveRecord/Arel have made queries much more fun).
The older erb templates are not the prettiest (though if you're doing PHP style script-in-page, you're using the tools wrong) - but using something like Haml is much, muc
Re: (Score:1)
Oh for fuck's sake. I get moderated down for asking a serious question? I really do want to know. What the hell is wrong with you people? I apologize if I stepped on the tail of a Ruby diehard, but the bloom is off the rose and I am curious why.
Re:Wasn't that supposed to be Ruby? (Score:4, Insightful)
You can write 'Modern Perl' in the sense used here without switching to an entirely different language:
http://www.onyxneon.com/books/modern_perl/index.html [onyxneon.com]
Re: (Score:2)
Oh for fuck's sake. I get moderated down for asking a serious question? I really do want to know. What the hell is wrong with you people? I apologize if I stepped on the tail of a Ruby diehard, but the bloom is off the rose and I am curious why.
You may only be extremely, unreasonably excited when speaking about Ruby!
Re: (Score:2)
Rails 3.1 is just coming out and offers some really, really nice features. Rails use is becoming more and more wide spread, and there are even hosts and cloud services that focus on it specifically (EG; Heroku).
Re: (Score:2)
Ruby has been in decline. Interestingly, so have PHP and Python. At it's peak in 2009, Ruby barely exceed's Python's current usage.
Ruby: http://www.tiobe.com/index.php/paperinfo/tpci/Ruby.html [tiobe.com]
Python: http://www.tiobe.com/index.php/paperinfo/tpci/PHP.html [tiobe.com]
PHP: http://www.tiobe.com/index.php/paperinfo/tpci/Python.html [tiobe.com] .
Re: (Score:2)
TIOBE is a very, very inaccurate index. Not just that, but they change the way they gather data every now and then, so historical values are not always comparable to current ones.
Re: (Score:2)
It doesn't really matter if the way they gather their data changes as the ratings are relative to the other tracked languages.
True. Unfortunately, due to the way they gather data, their relative ratings are also considerably inaccurate.
Would you contend that Ruby is in more widespread use than in 2009?
I don't know - I don't write anything serious in Ruby and am not part of the community, so I couldn't estimate where it's at today, or was at in 2009.
Overall, I do hear less noise about Ruby than, say, 2-3 years ago. But it may just as well mean that it had moved on from the Next Big Thing to a routine tool for many web developers, so telling about how awesome Rails is is not cool anymore, and hence
Re: (Score:2)
Wasn't Ruby supposed to be modern Perl for the web? Whatever happened to that?
Different community values.
Perl cares greatly about being fast, using few resources, maintaining long-term compatibility. It cares about the sysadmin (CPAN) and sysadmins seem to care about it (perl-Foo-Bar packages for almost all the important stuff). It caused quite a bit of pain about UNICODE and locales in 1997, when ~nobody knew why they were doing that silly stuff. mod_perl has been great for a decade - Passenger was just
Re: (Score:2)
All right, thank you to everyone who answered this seriously. I think I've gotten some idea now.
"Web development can be fun again" (Score:1)
Web development is already "fun" with the likes of Django, Rails (not a favourite of mine but I see the appeal) and my personal favourite: Pylons/Pyramid.
I don't really get the desire to use Perl. I haven't touched Perl for a long time and can't think of any jobs where it would be the best tool. It's ugly.
Sure, it's still better than PHP but then, what isn't?
Re: (Score:3)
The only exciting part of this new Mojolicious is to expand on a bunch of Perl web stuff you might already maintain. I don't have any large apps (like slashdot), but many "single page" type applications that process data or serve up custom reports. The simple pages simply flush stdout so when displaying long output appear speedy to the user. Others use some javascript and cludgy .html() replacements. Websockets and json support would be nice when extending these applications where the "bulk" of the code wri
Re: (Score:3)
I don't really get the desire to use Perl. I haven't touched Perl for a long time and can't think of any jobs where it would be the best tool.
String parsing and massaging.
Hashes.
Also, system administration. Like sed and awk, perl should be in most sysadmins' arsenal, seeing daily use.
Want to replace all occurrences of foo with bar in all files, while making a backup?
What perl is not good for, and frequently is abused for is providing multiple layers of abstraction. You burn memory at an alarming rate, and your code becomes even harder to maintain by "simplifying" it. If good perl code looks cryptic, add comment
Re:"Web development can be fun again" (Score:4, Insightful)
I don't really get the desire to use Perl. I haven't touched Perl for a long time and can't think of any jobs where it would be the best tool. It's ugly.
It's still _the_ tool for quick one-off type stuff. I know of no other tool that lets you just mash data together and produce something useful as easily and quickly as perl. That said, I'd never use it for a serious application or anything that had to be maintained for more than a few weeks. Those days are gone.. maintainability and reliability are king.
Re: (Score:2, Informative)
I don't really get the desire to use Perl. I haven't touched Perl for a long time and can't think of any jobs where it would be the best tool. It's ugly.
It's still _the_ tool for quick one-off type stuff. I know of no other tool that lets you just mash data together and produce something useful as easily and quickly as perl. That said, I'd never use it for a serious application or anything that had to be maintained for more than a few weeks. Those days are gone.. maintainability and reliability are king.
Well the really smart guys that figure out DNA started using it. Many startups use it. I've used it pretty much everywhere I've gone and it's leaps and bounds above what I find in use in most places. It's huge in Japan. It was the favorite language of the guy who created Ruby, he just wanted more.
So yeah no serious application or anything that had to be maintained, no never that, because how could anyone possibly write maintainable Perl. Instead you should use a programming language where maintainabili
Re: (Score:1)
Perl is for really old guys, period. If you're under 45 you're using python or ruby.
Re: (Score:2)
I'm decades under 45, and you can go fuck yourself with a rake.
Re: (Score:2)
I am quite a bit younger than 45 (as in over 20 years younger) and I use perl on a regular basis.
Re: (Score:2)
python isn't. colon starts a block. unindent ends the block. you can indent with what you like.
Re: (Score:2)
unindent ends the block
And that's not "position-is-syntax"... how, again?
Re: (Score:2)
http://www.secnetix.de/olli/Python/block_indentation.hawk [secnetix.de]
Re: (Score:2)
Very interesting. Doesn't answer the question exactly, though... None of those are actually "myths." They may be over-stated concerns, but they all contain partial truth, one of which is that position can be syntactically relevant.
Re: (Score:2)
That, uh, would seem to be the definition of position being part of the syntax. Unless I'm missing something...
Re: (Score:2)
don't you indent your code? The position is implied, even in perl. If you're indenting properly, then the closing brace becomes redundant.
Re: (Score:2)
Didn't say it was a bad thing (although I don't like it.. I find those redundant braces do add clarity for some reason.. ), still doesn't change the fact that in python, indenting is part of the syntax, whereas in other languages is just a good idea.
Re: (Score:2)
I guess. Then again, if your blocks in python are more than 3 or 4 lines long, then you're probably doing something wrong. It's referred to derogatively in python-land as "potato programming". Stuff like functools/itertools and list comprehensions are useful for avoiding "indent hell" where the indent becomes longer than the page and you start to lose track of where it all started. I hardly ever use if/for statements. It tries to encourage you to use it as a functional language rather than a procedura
Re: (Score:3)
Your example of Perl is Slashcode? I'm not sure that has the desired affect on the audience...
Re: (Score:3)
Never said it _hasn't_ been used to write something maintainable.. just that I wouldn't use it for that (any more.. ).
Yes you can write maintainable code in perl if you make a specific effort to do so, but to me that defeats the point. It's primarily a hack and slash language that lets you crank out code while you think. To me writing maintainable perl is like writing a quick one-off script in c++ or java. Yes you can do it, but why bother. Use the tool that is suited for the task.
And the DNA thing is a per
Re: (Score:2)
Yes you can write maintainable code in perl if you make a specific effort to do so, but to me that defeats the point. It's primarily a hack and slash language that lets you crank out code while you think. To me writing maintainable perl is like writing a quick one-off script in c++ or java. Yes you can do it, but why bother. Use the tool that is suited for the task.
Have you actually written Perl?
I mean, no offense, but that's just silly. Maintainable code requires a specific effort in Perl? But it doesn't in other languages? Can you provide anything to back that up? I can add use strict; use warnings to my perl and still have less boilerplate code than an equivalent Java (or C++, or even Python) program.
Writing maintainable code, in any language requires some effort. Period. Perl makes it no more difficult than any other language, and offers more assistance than
Re: (Score:2)
Perl can be as easy to read and maintain as the developer can be bothered to make it. Sloppy Perl is written by sloppy developers. It has proper variable scoping, namespacing, packages, object inheritance, etc. You also don't have to squeeze as much functionality into one line using as many special characters as possible.
Sure, there's plenty of ugly Perl out there. I suspect much of that is stuff that started as a small, quickly hacked together script which grew into something larger. Perl also used to
Re: (Score:2)
Re: (Score:3)
I agree that it's possible to write maintainable perl, but from my vantage point, perl is not really designed for this.
To me it's more of a hack n` slash language. Code while you think. All those shortcuts and lack of boilerplate code and ability to just say "take this data, compare it with this, and do whatever" in a few lines is to me perl's strength. The fact that the resultant code is hard to read is the weakness. If you are not going to do that, and write code in a more rigid, designed manner to avoid
Re: (Score:2)
I agree that it's possible to write maintainable perl, but from my vantage point, perl is not really designed for this.
To me it's more of a hack n` slash language. Code while you think. All those shortcuts and lack of boilerplate code and ability to just say "take this data, compare it with this, and do whatever" in a few lines is to me perl's strength. The fact that the resultant code is hard to read is the weakness. If you are not going to do that, and write code in a more rigid, designed manner to avoid this, why use perl in the first place?
The argument that it's not the tools it's the developer stands, however I do think some tools are more oriented towards maintainability (java, c++) and others towards rapid development (perl). You get ugly code in every language, but perl almost directly encourages it. The CPAN tool is _the_ definition of perl. Works, but oh my god is this code or cyphertext!
I think I see the problem here. It's a perception problem. You've decided that you want Perl to be a "hack n slash" language, so you view it in that way, and only in that way. I think you're seriously shortchanging Perl and pigeonholing it to something that doesn't match reality.
"Why use Perl" if you're not going to write sloppy code? Because there's a huge number of things that Perl can do really well. For example, using Mojolicious, it can be a great tool for designing web applications. Using CPAN,
Re: (Score:2)
I'd say that the perception of perl as a hack `n slash language didn't come out of nowhere. I'll accept this may have changed as I haven't used perl in a while, and when I did, it was maintaining a very poorly designed system... but it's pretty damn hard to deny that perl at least at one point was the definition of a write once read never language.
Re: (Score:2)
This a thousand times.
The purpose I see for Mojolicious is to provide an alternative to PHP, not Ruby, Python, etc.. If we can get people to use Mojolicious over PHP then when their project becomes a big deal it's easier to manage and maintain.
Re: (Score:2)
I created an entire social networking site in Perl
Not saying people don't use it, or that it's impossible to write maintainable code with it (or any other language), just that it wouldn't be my first choice. Perl doesn't force you to write messy unreadible code, but it does heavily encourage it, and to me writing rigid perl kind of defeats (in my view) the point of perl.
All that said, when it comes to web programming languages you don't exactly have a great set of choices.
and have been maintaining it for way more than a few weeks.
I guess the question would be, is it just you maintaining it. Would someone else be a
Re: (Score:2)
You can write a web server in VB6 if you want to, doesn't mean you should.
Perl doesn't force you to write ugly code, and with effort you can write maintainable code, but to me perl isn't designed for this. Perl is a hack and slash language, if you are going to stick to rigid designed code, why use perl in the first place.
Re: (Score:3)
For my part, I find it remarkably easy to implement RPC calls, CRUD especially, using this framework. Go to CPAN, read the Mojolicious::Lite exampes and decide for yourself whether it's worth your while.
Re: (Score:3)
By the looks of it Mojolicious does support stuff plain Django doesn't pay much attention to or leaves to the webserver (long polling for instance). Useful!
Then again, Mojolicious doesn't have a built-in ORM or input-validation via forms. Together with URL handling and the request/response loop these are the basic building blocks in Django.
So 'superior in important ways' depends on what you find important. I'm guessing 99% of Django users beg to differ.
Re: (Score:2)
Re: (Score:2)
Much agreed - this is one of the things Django does very well. Having said that, i think the model handling part of Django is it's weaker point. If you need to do anything remotely complex regarding persistance it gets too much in the way.
But yes. Most of the time, having a CRUD interface built automatically from the model it's a Godsend.
Re: (Score:2)
What happened to modularity?
Django advocates loose coupling between it's modules. You can easily use Django's ORM in a non-Django app, or use a different ORM (e.g. SQLAlchemy) in a Django app. Having said that, I've found that the Django ORM is nice and intuitive if you're a programmer (like me!) and really want to avoid working with SQL directly while SQLAlchemy caters to people who are more comfortable with SQL.
Oh boy (Score:3, Insightful)
Another perl web framework. I can't wait. I'm champing at the bit. /yawn
I use perl all the time, and have yet to run into a framework that actually saves time overall. They're generally designed by Unix guys who really don't want to think about web design any more than they have to - and it shows.
Re: (Score:1)
I think you are wrong there. Sebastian actually cares about the web. http://mojolicio.us/ was designed by the author of the framework himself, and as you can see it's not your typical Perl project home page. He even drew all the artwork.
Useful for just certain applications (Score:4, Insightful)
I suppose the idea is neat, but I personally don't have any particular applications where I need Perl to actually be the whole webserver for me. The things that do come to mind would involve a small system where there is no webserver installed, but going on port 80 would mean running the script with higher privileges and the whole mess of Perl and everything need to be jailed. Or maybe to try one of those utilities I heard about to pass privileged ports to an app, but I haven't had experience with those.
To be honest, frameworks left kind of a bad taste in my mouth when a language such as Ruby that had been around for years suddenly exploded when Ruby on Rails showed up. Everybody and their brother thought it was the new hip thing to use, until a lot of the bigger websites which had deployed it started to actually dump it due to limitations. Nobody wanted to take the time to write good code to start with, and it bit them in the butt.
Using frameworks (whether it's .NET or on the web or otherwise) usually starts out as a means to set up a new project quickly, but the problem is that they end up being an excuse to make sloppy bloated coat for the final product. Perl was always fast and efficient; people should learn to develop in it that way.
Re:Useful for just certain applications (Score:4, Interesting)
If I'm reading the docs correctly, the webserver part of Mojolicious is optional:
http://mojolicio.us/perldoc/Mojolicious/Guides/Cookbook#DEPLOYMENT [mojolicio.us]
It also supports a pretty substantial list of alternatives to its build in web server. Want to only run it as a CGI script? Then do that. Run your app as a PSGI script? Yeah, you can do that too. Started as a CGI script by now need a lot more HP? Not so hard to move what you started on something simple to something with a little more Umph.
So that's I guess, "neat"
Off topic (Score:2)
Re: (Score:1)
Apparently the span tag, which contains the icon and is narrower is width, has "overflow" set to "hidden".
Ironic in a thread about web development.
pretty? (Score:1)
I assumed it meant easier to read but longer to write, but looking over some comments here, is it used as a synonym for "made it easier?"
I mean, I find perl ugly but only because I can't read it very well. Otherwise I find it elegant.
Modern Perl? (Score:2)
Wouldn't that be Perl6 [perl6.org]?
Re: (Score:2)
Does it work yet?
Re: (Score:2)
I checked the release schedule.
First alpha: 2045
Second alpha: 3110
First beta: shortly before the north american continent collides with the asian continent
Second beta: approximately around the time of inteplanetary space travel
Release candidate 1: Dolphins have evolved fingers
Release:candidate 2: Human race enslaved by dolphins
Release: Universe dies of heat death
Re: (Score:2)
shortly before the north american continent collides with the asian continent
Actually, that happened a long time ago. Notheast Siberia and Northern Japan are on the North American plate. The Bering Strait is fairly recently dry land that has become depressed due to the compressive stress.
Re: (Score:2)
You could figure that out for yourself [github.com], but I suspect you're not actually interested in having your snarky rhetorical question shot down with an answer.
2.00 = 1.99 + 0.01: what's new? (Score:2)
Mojolicious has releases almost every day. 2.0 is just 1.99 + 0.01.
So what's new? It's just a new release that break things, like almost every others...
Re: (Score:2)
It's just a new release that break things, like almost every others...
My point is that the "release early, release really really really often" model of Mojolicious is hard to follow, and sometimes painful.
Also 2.0 being a major release just after 1.99 is quite unexpected as I've seen nothing announcing it (neither in Changes [metacpan.org] or on the blog [kraih.com].
About time! (Score:2)
The last time i fiddled with a Perl web framework was with Mason - i've been checking out Mojolicious and it looks really cool. It implements a lot of stuff that Django got right in a language that deserves more love than it usually receives.
Really cool stuff. I'll have to try it later at home.
mojo (Score:4, Interesting)
Totally apart from a pretty slick MVC framework the Mojolicious project has my undying affection for producing the mojo tool.
How many times have you wanted to scrape something out of a web page and you thought "I know, I'll use wget (or curl) and sed! Easy enough." so you write
# get story titles from slashdot
wget slashdot.org -O - 2>/dev/null | sed -e 's/uh, what now?//'
And then you get stuck fiddling with ever-crazier sed expressions to filter down to just the data you want? I know I've been there a dozen times and wound up with various unpleasant solutions or, when necessary, I've broken down and written a proper perl script which parses the HTML (and taken about 20 times as long as I planned to take to do it!) Maybe you try
And just go with it, because it's good enough. Well, no more! Now I can say
And have my results just like that!
Just as jQuery was a revolution in DOM scripting, to the point where I just won't write JS without it, so is mojo a revolution for these kinds of applications. I can now pull down pages and parse the actual structure and select just what I need. Beautiful.
Re: (Score:2)
Really nice. I have to try this.
Re: (Score:1)
Netcraft confirms that Perl is dead.
Re: (Score:3)
Re: (Score:1)
Isn't Perl 6 intended to do that? At least it finally gets rid of changing sigils by context. Which is probably the most confusing "feature" of Perl.
Re: (Score:1)
Re: (Score:2)
But if they can make perl as fast as the fastest javascript that would be very nice.
Re: (Score:1)
I recommend using perlbrew (http://perlbrew.pl) to install the latest version of perl in your home directory. Then you can just drop the sudo. You *could* also just install this thing using the normal cpan shell that ships with perl, cpanmin.us is just a convenience to make things easier.
With regards to the https - You might notice that http://cpanmin.us redirect to - https://raw.github.com/miyagawa/cpanminus/master/cpanm
Re: (Score:2)
I'm pretty much over it to be completely honest. To me modern Perl is Python. All the stuff you learn to hate about Perl just kind of goes away when you use Python. The only thing Perl really has going for it is CPAN. I have yet to find a programming language that has a resource that even compares to CPAN.
I think PyPi has a pretty good collection and, really, if I'm doing something that's complicated enough to where it's worth installing a 3rd party library, it's going to be in Python.