Take the 2-minute tour ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

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!

share|improve this question
3  
Perl 6 has not yet been released. If you need this for "real work", then concentrate on Perl 5. –  user1249 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! –  M. Joanis Dec 14 '11 at 6:59

8 Answers 8

up vote 18 down vote accepted

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.

share|improve this answer

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...

share|improve this answer

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.

share|improve this answer

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...

share|improve this answer

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.

share|improve this answer

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

share|improve this answer

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.

share|improve this answer
1  
Actually javascript is the king of script. –  Daniel Little Dec 17 '10 at 4: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? –  M. Joanis Dec 17 '10 at 4: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) –  user1249 Dec 17 '10 at 16:18

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...)

share|improve this answer
    
Hehe... vapourware ftw! –  Simon Whitaker Dec 17 '10 at 14:16
1  
Perl 6 doesn't use regexes, it uses rules (and they're awesome!): en.wikipedia.org/wiki/Perl_6_rules –  Gaurav Apr 28 '11 at 18:13
    
New Joke needed. –  Sean McMillan Oct 7 '11 at 15:01
    
@SeanMcMillan A joke I made last year is old? :P (I can't help it if Duke Nukem Forever has been released in that time...) –  Kevin Cantu Oct 10 '11 at 21:10

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.