Earlier quoted context omitted.
"Smart" match is a pile of shit, and anyone reading the manual description for it should conclude the same. You can't know what it does unless you can remember the details of a 23-item table. It's undergoing major revision, and not a minute too soon.
Is it that bad in Perl 6 too?
Learn Perl in about 2 hours 30 minutes
71–80 of 111 posts
Re: Learn Perl in about 2 hours 30 minutes
#72Earlier quoted context omitted.
Were you previously a Perl programmer at all? And are you learning it for any particular purpose? I've always wanted to give Perl a go but can't find something I want to use it for.
No previous Perl programming-experience. I've been consciously aware of Perl since at least 1998 and even poked at the source code of some scripts here and there, but didn't bother to really learn anything about it until recently. A brief explanation; perhaps someone here will be inspired or is thinking along similar lines: I've been using an "object system" for JavaScript named Joose: http://joose.it/ Joose is amazi…
Re: Learn Perl in about 2 hours 30 minutes
#73Question: Why don't people transition to Perl 6?
Not enough people on the bandwagon, competition from Ruby/Python/JVM languages on the high end and Perl 5 on the low end, and last but not least the fact you can't use libraries written for Perl 5 with Perl 6. I wrote a medium-sized project in Perl 5 two years ago. It is my day job right now to work on it. I have very little interest in rewriting it from scratch in any language, but if I did, it would probably be eit…
Re: Learn Perl in about 2 hours 30 minutes
#74Earlier quoted context omitted.
Oh my why would anyone want to lean Perl anymore? Because it's powerful, it's easy to start, it's flexible, it's productive, it's ubiquitous, and it has an unparalleled extension ecosystem devoted to quality and ease of use.
lol so do all the languages mentioned above plus they are prettier.
Re: Learn Perl in about 2 hours 30 minutes
#75I've been working with Perl programmers for just about ten years now and the one thing I've sadly learned is that while many folks claim to know Perl, but only a small group can do it well. (although granted you can apply this reality to any other programming language)
"Write once, read never" comes to mind. So many single/double char operators which need to be memorised with Perl, before you can start comprehending the programs. Not to mention Perl hackers used to pride themselves on super succinct code - in certain circles it use to be popular to include one liners to do complex stuff in email signatures. (Not complaining though, Perl was the first language I used, and probably t…
Regarding other stuff, building good software requires understanding a lot of things which have nothing to do with Perl. Understanding concepts like recursion, closure, OO, functional programming concepts etc etc. These have to be first understood in theory. The Perl syntax is only a notation in which you express your ideas. Besides that designing good software requires people to understand design patterns, designing maintainable software requires people to work on large project under sound practices. Writing fast and efficient software requires people to learn Algorithms and data structures. And so on...
These principles remain the same regardless of the programming language you use. Then why is it that only in case of Perl people hold the language responsible for everything. To be frank, I have seen crappy code more often in other languages than in Perl. I have seen over abuse of certain element like XML in Java, and now these days Python.
The fact is if your technology community is huge you get a lot of crappy people along with your usual set of good people. This happens for various reasons, Everybody wants to learn something that is famous as it helps for Job reasons.
Perl's strength apart from your usual language kit is CPAN, language tools to produce highly useful rapid scripts in time. Heavy data lifting, data munging. A gentle glance at things like Moose, Modern Perl, Devel::Declare and all associated software with them(Catalyst, DBIx::Class), will show you the genius of Perl community in coming up such great stuff in time.
Re: Learn Perl in about 2 hours 30 minutes
#76Earlier quoted context omitted.
No previous Perl programming-experience. I've been consciously aware of Perl since at least 1998 and even poked at the source code of some scripts here and there, but didn't bother to really learn anything about it until recently. A brief explanation; perhaps someone here will be inspired or is thinking along similar lines: I've been using an "object system" for JavaScript named Joose: http://joose.it/ Joose is amazi…
Anecdote which amuses me: I find JavaScript tolerable thanks to Joose and other ideas borrowed from Perl.
The JavaScript community as a whole (seen especially in the direction of node.js + NPM) is moving away from global namespaces and toward the "module pattern" and dependency injection (note: I had no idea what those terms really meant 6 months ago).
Presently, Joose3 goes against that grain. For example, if in a node.js script you:
require('joose')
if (Joose) { console.log(true) } // prints true!
Basically, the global namespace gets auto-populated with "Joose" and a chain of namespaces below that. This is very Perl/Moose-like, of course.When you define classes, roles, etc. you get similar behavior:
Joose.Class('MyClass', {...})
if (MyClass) { console.log('effectively stubbed in a global namespace!') }
// does log that text to console, as Joose.Class() behaves that way
And in fact, Joose3 encourages you to embrace that behavior (with `use:` builders and lots of discrete files) to arrive at a network of cross-referenced namespaces which altogether form a library, and API usually.To go with the flow, and especially to take advantage of emerging module specs like AMD (commonjs thing), a redesigned Joose (i.e. Joose4) needs to eschew global namespaces entirely:
var myJuice = require('joose')
...
// There should be no tie to a "Joose" namespace as such
But how to do that, and elegantly?Any wisdom from the Perl community in that regard? Maybe someone else has been trying to port Perl stuff to JavaScript/node.js and has found the perfect formalism for translating from global namespaces -> module pattern + dependency injection? Know any Moose wizards that would be willing to help explore this matter?
Re: Learn Perl in about 2 hours 30 minutes
#77Oh my why would anyone want to lean Perl anymore? Unless you are working with a legacy codebase learn Python, Ruby, Java, C#, Erlang, Scala, Haskell... in other words run the f away from Perl if you can unless you are into S&M.
I hear about new Perl projects starting in large enterprises everyday!
Unless you are in the web programming domain(Somehow web developers think their's is the only software being written in the whole world) where your Python and Ruby frameworks seem to be famous. Perl is pretty big in the backend.
Perl is here to stay, and its simply too useful to be going away anytime soon.
Re: Learn Perl in about 2 hours 30 minutes
#78Would it be beneficial to know this alongside of Python, or is it more used instead of Python?
Perl has its own strengths. In order to win as scripting language on the UNIX environment a language will have to get some things right very well. Two of them namely 'Processes' and 'Files(text)'. UNIX is really about these two things heavily. That is why you will see UNIX by a vanilla installation has shipped with tools like sed, grep, awk, cut, tr, cat and other text processing tools for decades. Because a file can act as a pretty good representation for data, storage and problem representation use cases. Another area that the language will have to get right is 'DBMs'.
Speaking of Perl's merits as scripting languages alone, Perl offers a native way of interacting with all these things that I mentioned in the previous paragraph. Things like ``, system(), open(), close() , die(), chomp, while), split(), grep, !~ , ~= and regular expressions make text processing a breeze. In addition, Higher order parsing is very easy in Perl too, Regular expressions are first class objects. For more information on this you can read Mark Jason Dominus's Higher order Perl. Which is a free book.
Now coming to Perl's merits as general purpose scripting language. You have your usual language tool kit with data structures(usual numbers, strings), arrays, hashes. Flow control, functions, OO, functional programming features. But the plus and the biggest winner is the extension system. There is a huge repository of readily solved problems on the CPAN. You have language extension modules like Moose, Try::Tiny, etc etc.
In terms of the web development ecosystem, Perl has catalyst, DBIx::Class, Plack etc etc. You also have a good asynchronous programming framework.
In terms of documentation. Check out the amazing perldoc.perl.org. There is also Learning Perl, Programming Perl and recently Chromatic's beautiful book 'Modern Perl book'.
In terms of development practice and stability. Perl has a track record and battle tested for decades now, Its used to develop mission critical applications. For best practices you can read Damian Conway's Best practices book.
Also, Checkout enlightened Perl and Task::Kensho for the best of the breed modules.
As a plus and cherry on the cake, there is a new sister programming language called Perl 6 in the making. With great concepts, cleaner defaults and more pragmatic in the real world.
Perl 6 is usable today with Rakudo. Give it a whirl.
Re: Learn Perl in about 2 hours 30 minutes
#79Earlier quoted context omitted.
lol so do all the languages mentioned above plus they are prettier.
I don't think you read what you're responding to. How can they all have an "unparalleled extension ecosystem"?
And FYI pypi is better than CPAN so all the other stuff in the that post is crap imho. I was a Perl dev for ~10 years. Now have about 5 worth of Python. So thank you.
Re: Learn Perl in about 2 hours 30 minutes
#80Oh my why would anyone want to lean Perl anymore? Unless you are working with a legacy codebase learn Python, Ruby, Java, C#, Erlang, Scala, Haskell... in other words run the f away from Perl if you can unless you are into S&M.
Legacy? I hear about new Perl projects starting in large enterprises everyday! Unless you are in the web programming domain(Somehow web developers think their's is the only software being written in the whole world) where your Python and Ruby frameworks seem to be famous. Perl is pretty big in the backend. Perl is here to stay, and its simply too useful to be going away anytime soon.