21

I have started playing around with Perl 5 lately, and it seems very interesting. I would like to spend some time learning it more in depth when I can.

My question, since Perl 6 is slowly taking place (I believe...) and is said to break backward compatibility, is this: am I better learning Perl 5 and then Perl 6, or is learning Perl 6 directly a better time investment according to you?

If the changes from Perl 5 to 6 are making it hard to understand Perl 5, I should certainly start with Perl 5 to be able to read "old" scripts, then check Perl 6. There is also the "Perl 6 is not yet completely released" problem. I know there's an early adopter implementation for Perl 6, but if Perl 6 isn't officially released before some more years, I'll stick to 5 for now.

I would certainly like some insight on this. Feel free to discuss related stuff. My interest in scripting languages is fairly new.

Thanks!

Joanis
  • 1,364
  • 2
  • 12
  • 14
  • 3
    Perl 6 has not yet been released. If you need this for "real work", then concentrate on Perl 5. –  Dec 17 '10 at 16:17
  • Going with the votes, after all this time, but many interesting answers IMO. I like that you brought the idea that Perl 5 and 6 should considered different languages. Thanks! – Joanis Dec 14 '11 at 06:59

8 Answers8

21

Perl 5 and Perl 6 are different languages, not two versions of the same. Perl 6 is heavily inspired by Perl 5, but not exclusively. I would suggest focusing on Perl 5 for now. If you watch the community (I'd suggest the Planet Perl Iron Man aggregator, you'll also see posts and content from the Perl 6 community and can keep an eye on it. Also, many features of Perl 6 are slowly coming back to Perl 5.

Also: Despite some people's hate for Perl, it's 2010 now, not 1995 anymore, and Perl has immensely moved forward, and continues to do so.

phaylon
  • 647
  • 3
  • 7
13

Yes to Perl 5

Sure, go learn Ruby and even Python, but Perl is different. And intelligent beyond reason. Perl is one of those languages that you can learn things you never wanted and be glad you did and yet will have to re-read the Camel book every couple of years just so you don't fully mentally purge your perlisms.

Perl is of alien syntax, even to the most seasoned professionals. Personally, I believe you will expand your horizons with Perl.

Perl 5 is what I consider to be Perl 1.5. Perl 6 is what I consider Perl 2.0, maybe should even be named something different completely, so yes both 5 and 6 are worth learning in their own right and for their own merits. Disclaimer=I'm still struggling with Perl6 myself...

Jé Queue
  • 3,937
  • 2
  • 29
  • 37
4

In answer to the question in the headline: yes!

As you pointed out, focusing on Perl 5 is by no means a waste of your time, since the vast majority of examples, tutorials, and applications in Perl will be from the 5 branch.

This said, you should certainly keep up with the Perl 6 project and its progress. I took some time to learn Python 3 before it's first release, just so I understood what changes were being made and why. This helped me when migrating from the 2.x codebase to 3.x.

I wouldn't invest too much time learning the ins/outs of Perl 6; a deep understanding of Perl 5 will serve you better for the time being. But once it's been released (whenever that bloody is), a basic understanding of Perl 6 will help you keep moving forward.

bedwyr
  • 2,202
  • 1
  • 18
  • 21
3

Perl 5 is the stable line, which will probably develop on a different line than Perl 6. Perl 6 is probably going to have to figure out a new name than Perl.

Perl 6 is, frankly, awesome. But it's not stable enough yet for enterprise use in production (at least, from what I understand). Of course, stable in the enterprise means Perl 5.8 in my experience...

Paul Nathan
  • 8,560
  • 1
  • 33
  • 41
1

Best advice: no, no, no! Perl 5 is best right now since Perl 6 is not fully developed.

Dynamic
  • 5,746
  • 9
  • 45
  • 73
1

Don't learn Perl 6.

CPAN doesn't even support it yet. (I suspect it will ship with a module that allows Duke Nukem Forever to be played entirely through the use of regexes...)

Kevin Cantu
  • 333
  • 1
  • 4
1

Perl 5 is stable now and I think one must learn the most recent stable version first. Upgrading to another version would then become easier.

Abi
  • 155
  • 1
  • 4
0

If you are interested in scripting style languages, I would suggest learning Python and/or Ruby instead. I first learned Perl several years ago. The main thing I learned from it is regular expressions. Most other languages that have built in regex are derivatives of the Perl implementation. But beyond that, I didn't use Perl for all that much. The main criticism of Perl is that some consider it a 'write-only' language. It is very hard to come back to old code and easily understand what was done.

It's my perception that more progress is being made with Python, and Ruby (like Rails), than there is with Perl. It's always good to stretch your brain an learn a new language, but Perl probably wouldn't be a top suggestion.

Erik
  • 999
  • 5
  • 16
  • 1
    Actually javascript is the king of script. – Daniel Little Dec 17 '10 at 04:40
  • Thanks for the input. Seemingly, Perl would be a not so good choice nowadays. Just curious though... Is it as easy to write awesomely concise one-liners at shell prompt with Python, Ruby and Javascript? – Joanis Dec 17 '10 at 04:46
  • 3
    Perl has changed a lot since the old days. And there are many people still opting for it, and learning it. Things like testing, documentation, interoperability, backcompatibility, stability and a focus on a good toolchain are more modern attributes of Perl. – phaylon Dec 17 '10 at 14:07
  • In my experience, learning Perl helps with learning Ruby, since many concepts are shared. – justkt Dec 17 '10 at 14:45
  • Perl regexps CAN parse HTML (or something) –  Dec 17 '10 at 16:18