3 ms·
This title should be "cool thing in Perl 6." It's just a tiny blogpost about subsets. There are zero other new features mentioned. And who uses Perl these days
by andrewljohnson 17y ago
This title should be "cool thing in Perl 6." It's just a tiny blogpost about subsets. There are zero other new features mentioned.
And who uses Perl these days anyways? I can't think of a task I wouldn't rather script in Python.
I remember the glory days of web scraping when all a man had was LWP, Mechanize, and his own mastery of regex to work with. But those days are long gone!
- berntb 17y agoA reason not to use Python: To avoid being identified as a kid that love language wars. I motivated that with an example, which arguably is better than what I comment on. :-) But seriously, the large majority of Perl articles on HN gets that kind of garbage. Give it a rest, please. At least don't show the world you lack better things to do.
- jrockway 17y agoBut don't you get it? His religion is under attack -- this is life or death. If someone is using Perl, it could mean his choice is wrong. And if you pick the wrong programming language, everything you've ever written in it will magically stop working. So you can see why it's worth getting upset over. Just the other day I found that my favorite color, green, is no longer the most popular. Everything green I owned then instantly turned orange. Now I am stuck looking at orange things all the time! It's tragic! And could surely have been avoided if I told everyone that green was better on web-based discussion forums.
- mock 17y agoLots of us use Perl these days. For example those of us that care about speed, stability, and sane backwards compatibility. WWW::Mechanize is still a great tool when appropriate. Catalyst and Moose are pretty awesome to work with as well. I'm pretty happy with the state of Perl these days, there are lots of reasons to recommend it, but if Python works for you, that's cool too. Slightly more on topic - when Ovid first posted this to his feed, Stevan Little pointed out that you could already do it in Perl 5 ( http://gist.github.com/268717 http://gist.github.com/268717 ). Watching the give and take between the Perl 6 language and the Modern Perl movement is (I think) one of the more interesting and exciting areas of language development these days.
- draegtun 17y agoThanks for posting Stevan's gist... I hadn't seen that elsewhere. When I first saw Ovid's post I could see a MooseX::Declare lightbulb going off in my head ;-) use 5.010; use MooseX::Declare; class Foo { use MooseX::Types -declare => [ qw(Filename) ]; use MooseX::Types::Moose qw(Str); BEGIN { subtype Filename, as Str, where { -x $_ }; } method file ( Filename $name ) { say "Houston, we have a filename: $name"; } } my $foo = Foo->new; my $perl = `which perl`; chomp $perl; $foo->file( $perl ); $foo->file( 'no_such_file' ); Above throws the expected exeception on 'no_such_file'.
- jrockway 17y agoThis reminds me that it would be nice if someone wrote a module that produced type constraints like: File[Exists] File[Readable, Executable] Dir[Empty] as an extension to MooseX::Types::Path::Class.