Slashdot Mirror


Perl's Extreme Makeover

PurdueGraphicsMan writes "There's an article over at Yahoo! about the upcoming version of Perl (version 6) and some of the new features (RFC list). From the article: "Although Perl 5's expressions are the most sophisticated available and aspired to by other programming languages, "no one pretends for a moment that they're anything but hideously ugly," said Damian Conway, a core Perl developer and associate professor at Monash University in Australia.""

129 of 408 comments (clear)

  1. Whew, backasswards compat-with Perl 5 by microbob · · Score: 4, Funny

    Good! Looks like they kept Perl5 in mind and it will flip into a special mode to execute older Perl5 code.

    Nice!

    -mb

    1. Re:Whew, backasswards compat-with Perl 5 by ikewillis · · Score: 4, Informative
      Not only is it backwards compatible, but thanks to Perl 6's new modular architecture, Perl 5 code will simply include a separate parser/compiler which will generate code which will execute through the Parrot runtime, which adds a number of optimization benefits (at runtime, even) not currently possible through the current Perl 5 compiler/parser/runtime mush.

      Consequently, Perl 5 code should run faster under Perl 6.

    2. Re:Whew, backasswards compat-with Perl 5 by fanatic · · Score: 2, Interesting
      the current Perl 5 compiler/parser/runtime mush.

      But how does eval $string work in a runtime with no compiler?

      --
      "that's not encryption - it's a new perl script that I'm working on..." - from some Matrix parody
  2. Perl: The Beginning by Anonymous Coward · · Score: 5, Funny

    a ,There's been
    a 0 an explosion
    a /|\ at the ASCII
    a | factory!!!!
    a /|

    1. Re:Perl: The Beginning by perly-king-69 · · Score: 4, Interesting

      well, this is quite proper and normal syntax:
      s/(.*?\s+)\(.*?\)/$1/g
      Looks like an explosion in the ascii factory to me!

      --

      --
      This sig is inoffensive.

    2. Re:Perl: The Beginning by sumengen · · Score: 2, Insightful

      What's the point of giving a regular expression example? C# has the exact same regex syntax, as others (uglier actually).

    3. Re:Perl: The Beginning by perljon · · Score: 4, Insightful

      s/(.*?\s+)\(.*?\)/$1/g

      This is trying to match something like adsfdfsdfs()ASDfasd#@$!@afd (adsfad@#$@!)
      and replace it with
      asdfa asdfa asdf adsfdfsdfs()ASDfasd#@$!@afd

      or basically, get rid of things in parenthises that are after at least one white space.

      so,
      s/\s+\(.*?\)//g would work...

      but still a lot of slashes

      so try this
      my $stuffInParen = qr| \(.*?\) |;
      s/\s+ $stuffInParen //gx;

      or even
      my $stuffInParen = qr| \(.*?\) |;
      my $whiteSpace = qr| \s+ |;

      s/$whiteSpace $stuffInParen//gx;

      now, you can look at the code and have a pretty good idea what it's doing. (even without comments). we're switching stuffInParens that follow whitespace with nothing. just because Perl gives you the flexability to write ugly code doesn't mean you should. if you are writing perl code and it looks ugly, you're doing it wrong. you should find another way to do it... with great power comes great responsability.

      see http://www.perl.com/lpt/a/2003/06/06/regexps.html for more info.

      --
      This isn't the sig you are looking for... Carry on...
    4. Re:Perl: The Beginning by mrogers · · Score: 5, Funny
      now, you can look at the code and have a pretty good idea what it's doing.

      With the greatest respect, I think you're missing the point of Perl. If you can understand your code, the Indian programmer who replaces you can understand it.

    5. Re:Perl: The Beginning by aerique · · Score: 2, Insightful

      The novice had a problem. "I know", thought the novice, "I'll just use regexps!" The novice now has two problems.

      -- Erik Naggum, comp.lang.lisp

  3. Perl Haikus by Anonymous Coward · · Score: 5, Funny

    Okay, about 99% of the Perl Haikus will not apply anymore.

  4. Trolling, maybe by fsterman · · Score: 2, Interesting

    We might be able to actually use them in ten years or so... I do appreciate Open Source speed (done when done) and Perl is pretty complex but maybe they should have broken the upgrades into parts?

    --
    Is there anything better than clicking through Microsoft ads on Slashdot?
    1. Re:Trolling, maybe by irc.goatse.cx+troll · · Score: 4, Insightful

      Perl5 has lasted us 10 years. If they were to do one major change a month, messing with backwards compatability in your scripts would become a major pain. This way its atleast one major headache rather than a decade long depression.

      --
      Pain lasts, kid. Its how you know you're alive. Sometimes I think this growing up thing is just pain management-TheMaxx
    2. Re:Trolling, maybe by rgmoore · · Score: 5, Informative

      You might be interested in Ponie, then. Ponie is the project to create a Perl5 interpreter for Parrot. It should let you get much of the speed benefit of the new virtual machine without having to learn the new Perl6 syntax. Of course you may still want to learn the new syntax, since it will add many powerful new features, but Ponie will ensure that Perl5- and all of the work you've put into your Perl5 scripts- won't be completely abandoned just because Perl6 has come out.

      --

      There's no point in questioning authority if you aren't going to listen to the answers.

  5. We're all going to die by StuWho · · Score: 5, Interesting
    "But Perl also will remain a language with the diehard developer fans who are the impetus behind its popularity. "Personally, I'm hoping to get Parrot embedded into games and office suites," Sugalski said. "I for one would love to write my word processing macros and game scripts in Perl or Forth rather than in whatever hand-rolled language someone's come up with."

    Back to Pac Man and Vi then...

    --
    "If you think nobody cares if you're alive, try missing a couple of car payments." Earl Wilson
  6. quick question.... by thepyre · · Score: 5, Funny

    "no one pretends for a moment that they're anything but hideously ugly," Does he mean the lines of code or the programmers themselves?

    1. Re:quick question.... by gUmbi · · Score: 5, Funny

      Yes.

    2. Re:quick question.... by Anonymous Coward · · Score: 2, Funny
      It's fair to say perl is the deadbeat dad (as in got drunk fucked a bar slut and haven't seen her since) for python, php, and ruby.


      I don't know what other modern scripting languages you use.

    3. Re:quick question.... by imipak · · Score: 2, Interesting

      I must be sick in the head or something, but I fell in love with Perl reading the 'Learning Perl v4' llama on the tube in 96 - to me the elegance simplicity and yes beauty of the code really took my breath away. Good Perl code is one of the few things that aren't music that genuinely move me, tickle my aesthetic dangleberries as it were.... I mean... while (){ print; }... *sigh* no really. I'm serious. Granted I was programming in Visual Basic when I fell for Perl - frmo the ridiculous to the sublime really....

    4. Re:quick question.... by mrogers · · Score: 3, Funny

      Journalist: Bob, you've gotta help me! My article about Perl 6 is due in an hour. WTF is Perl?
      Bob: Uh... it's an internet programming language. The webmaster's always talking about it.
      Journalist: Great - I'll put "critical in the initial construction of the internet". When was it invented?
      Bob: I dunno. It's pretty old though, it still uses ASCII.
      Journalist: Don't get technical with me, I'm on a deadline. So what do you know about the new version?
      Bob: I heard it's going to be a completely new language. The expressions are all going to be regular now, and the grammar's going to be regular.
      Journalist (typing): Hmm... I could put in something about Latin... Perl as the lingua franca of the Internet... nah, don't want to go over their heads. OK, gotta go. Thanks for your help, Bob.
      Bob: No problem man, just don't quote me.

  7. Expressions .. by Billly+Gates · · Score: 4, Insightful

    .. is why I prefer python over perl. The resulting code is soo much cleaner.

    I suppose it has to do with the old debate of losely or strict typed langauges. Perl is highly modular but I would hate to work in a team of 10 or more perl developers all writing in their own styles and methods. Shudder.

    Yahoo decided to support php rather then perl in their next generation yahoo services specificially because of "There is more then one way to do it".

    Of course its all being outsourced to India now where they can just hire more developers if complex problems arrise

    1. Re:Expressions .. by Xzzy · · Score: 5, Insightful

      > .. is why I prefer python over perl. The resulting code is soo much cleaner.

      Yes but you have to admit that perl has a certain charm about it.

      Haven't you ever sat there staring at a subroutine, thinking to yourself "man I sure wish I could just hold shift and slide my finger over the number row to get this done"? Then gone on and painstakingly crafted what you wanted to do in whatever strict language you were actually working in? ;)

      Maybe it's just me. But every time I sit down and promise myself to write a new script all tidy and clean in python, about five minutes into it I'm muttering "if this were perl I coulda been DONE by now" and quickly revert back to old faithful.

    2. Re:Expressions .. by kfg · · Score: 4, Insightful

      Yes, but the flip side comes only a day later, when I sit down at my Python code and immediately start editing.

      Whereas I look at my Perl code for about an hour and a half thinking, "Ummmmmmm, what the fuck is this supposed to mean?

      Not that either of them have a patch on APL, mind you. APL Roolz.

      KFG

    3. Re:Expressions .. by Goaway · · Score: 3, Funny

      So does a man standing next to, you holding a gun to your head, saying "INDENT THOSE BLOCKS!".

    4. Re:Expressions .. by Tony+Hoyle · · Score: 4, Insightful

      Untrue.. I've seen code in my lifetime that would turn your hair grey. It's pretty easy to write unreadable junk in most languages. Perl makes it *really* easy (since almost everything you type will compile.. it's making it do anything useful that's the hard bit), and alas a lot of people seem to be churning out the junk daily.

      If you haven't got the time to write something properly, forget it - you'll only regret it if you write junk.

    5. Re:Expressions .. by Gherald · · Score: 2, Interesting

      >> Python enforces clarity

      > So does a man standing next to, you holding a gun to your head, saying "INDENT THOSE BLOCKS!".

      Certainly, but somehow Python doesn't make me feel quite as nervous.

      Besides, there are too many availeability and cost issues with men-standing-next-to-you-holding-gun-to-your-head,
      whereas Python is 100% free, which I've found to be much more convenient.

    6. Re:Expressions .. by consumer · · Score: 4, Insightful
      Yahoo decided to support php rather then perl in their next generation yahoo services specificially because of "There is more then one way to do it".

      Pretty ironic when you consider that PHP has exactly the same issue, along with some other issues Perl does not have (lack of namespaces, inadequate comparison operators, etc.).

    7. Re:Expressions .. by Christianfreak · · Score: 2, Interesting

      Perl is highly modular but I would hate to work in a team of 10 or more perl developers all writing in their own styles and methods. Shudder.

      Its called DISCIPLINE and its not that hard. Someone makes rules for the dev team and then they are followed and then your code is clean and readable. Why should the language force you to be disciplined? Good programmers know to program following some kind of standard.

      And why does everyone bring up PHP? PHP is nothing but Perl with all the best parts taken out and everything thrown into the core language. PHP breaks all the rules of good disciplined programming. With Perl you can shoot yourself in the foot but at least the newbies stay away from it enough to keep the damage to a minimum, and it has controls such as 'strict' and Taint mode so you know when you are shooting yourself in the foot. PHP on the other hand gives the newbies a shot-gun and says 'point this at your head'. PHP coders that actually understand the basics of good programming are few and far between. And trust me there is more than one way to do things in PHP as I've been fixing the problems created by the former 'programmer' in my company for the last year.

    8. Re:Expressions .. by Bingo+Foo · · Score: 2, Funny
      Whereas I look at my Perl code for about an hour and a half thinking, "Ummmmmmm, what the fuck is this supposed to mean?

      Which is why you use comments like this:

      s/(.*?\s+)\(.*?\)/$1/g # PC LOAD LETTER
      --
      taken! (by Davidleeroth) Thanks Bingo Foo!
    9. Re:Expressions .. by takshaka · · Score: 2, Interesting

      I've seen plenty of poor Perl code, but I wouldn't call any of it unreadable--just bad. Writing truly unreadable code in Perl requires a much higher level of mastery than most people ever acquire.

    10. Re:Expressions .. by mcrbids · · Score: 2, Interesting

      Maybe it's just me. But every time I sit down and promise myself to write a new script all tidy and clean in python, about five minutes into it I'm muttering "if this were perl I coulda been DONE by now" and quickly revert back to old faithful.

      Funny. I feel the same way about PHP. It's routine for me to take some broken, busted stuff written in Perl or c or whatever, and redo it in PHP in 1/4 the lines.

      As Jethro Tull once said:

      "You know what you like, and you like what you know".

      I can "do" Perl, but it brings me much grief to do so. While I find PHP consistently readable and understandable, pretty much no matter who wrote it.

      Oh, and BTW, since I've taken the time to "get" regex, I don't even find it ugly. The earlier example about $stuffinParen or whatever was hideous, and not nearly as understandable to me as the simple, concise, original example. Einstein once said:

      "Everything should be made as simple as possible -- but no simpler!".

      --
      I have no problem with your religion until you decide it's reason to deprive others of the truth.
  8. The Parrot Engine? by blcamp · · Score: 2, Insightful


    Will that make Perl 6 coders a different kind of "Parrot Head"?

    --
    The problem with socialism is that they always run out of other people's money. - Margaret Thatcher
  9. What everyone knows about perl by HappyCitizen · · Score: 5, Funny



    Unreadable code,
    Why would anyone use it?
    Learn a better way.

    ugliness that grows
    into beauty inside of
    your favorite shell

    Arbitrarily
    Nested structures for data;
    Joy of birds in flight.

    As with the spring rain
    Perl is indispensable
    Unquestionable

    http://aspn.activestate.com/ASPN/Perl/Haiku/Abou tP erl

    --
    http://www.beyourowneviloverlord.tk
    http://www.frozenchickenthrowing.tk
    http://www.killercamel.tk
  10. Anyone who intimately knows 5 by devphaeton · · Score: 4, Interesting

    ...would be able to tell me if i should

    a) start learning 5 anyways

    or

    b) wait till 6 is released, because going from barely having a grasp on 5 and then trying to learn 6 would just confuse myself?

    i realise that all the perl5 code in the world won't suddenly cease function the minute perl6 is released, but still..

    I can see the value in perl, and what a great tool it is, but for some reason i have a hard time wrapping my lil brain around it. It's a bit less "structured" or "consistent" than say C is. I suppose it has to be that way in order to do what it does, though.

    --


    do() || do_not(); // try();
    1. Re:Anyone who intimately knows 5 by smack_attack · · Score: 5, Interesting

      Learn 5, because it will probably take a few months until 6 is standard. Either way, in a few years you will look back on whatever you coded today and shake your head in shame. /used to printf() every line when he learned PHP

    2. Re:Anyone who intimately knows 5 by deja206 · · Score: 3, Insightful

      As a Perl 5 programmer, I don't think Perl 6 will be all that good.

      Not everyone will switch immediately, and not everyone will need/want to switch anyway.

      I say go on and learn Perl 5, you won't regret it...

    3. Re:Anyone who intimately knows 5 by psycho_tinman · · Score: 5, Informative

      I cannot claim to intimately know Perl 5, but I started learning it a few years back. I belong to the camp of Perl programmers (and I know there are a few of these) who are adopting a "wait and see" attitude to Perl 6.

      If you're interested in learning Perl now, you should probably go for the cookbook approach, ie: get a copy of OReilly's Perl cookbook and just try applying the solution to your problem. Then, trying tweaking and figuring out how it works.

      As for learning Perl 5, I'd probably point out that there are still some places that run 5.005_03 (certainly Solaris used to ship with that version by default), and that version is at LEAST 5-6 years old :) There are even some places I've heard of that run Perl 4 :) So, I think there is plenty of time to have your investment in learning Perl pay off before people start switching to Perl 6 en masse.

    4. Re:Anyone who intimately knows 5 by Telastyn · · Score: 5, Informative

      Personally, I found that perl was kind of odd and not fantastic until I learned perl with regexes [via O'Reilly's Mastering Regular Expressions, highly recommended]. Then alot of the little nuances made alot more sense. Alot of the examples in that book were things perl does easily in a few lines, but would cause most programmers to gouge their eyes out if they needed to do it in C.

    5. Re:Anyone who intimately knows 5 by amplt1337 · · Score: 3, Insightful

      It's all going to depend on how much they change the syntax, which Yahoo!!!!!111! doesn't seem to be providing us with right now. (I'm sure if I were on a perl list I'd hear more about it.)

      Personally what I'd recommend (as a full-time perl programmer) is to learn 5 anyway. It'll take two or three years before the next edition of the Llama (O'Reilly, _Learning_Perl_, look it up your own darn self on Amazon if you must) is out, and in the meantime you can get out of the baby-talk phase this way. Learn regular expressions thoroughly, absolutely thoroughly, backwards and forwards, even if you won't need to use most of the complex stuff -- you'll wind up using it sooner or later, and if you know if cold, then you've got better odds of remembering something obscure when you need it. [Caveat: apparently regexes are a big part of the language changes. So learn the Perl 5 regex engine as thoroughly as you can, and then compare and contrast with this rundown on the new stuff.]

      Obviously core language features aren't likely to go anywhere, and you won't be wasting your time learning them. And you'd be amazed at what even a couple of months will do for your language maturity.

      Start now. No sense putting it off.

      --
      Freedom isn't free; its price is the well-being of others.
    6. Re:Anyone who intimately knows 5 by ChaosDiscord · · Score: 5, Insightful
      start learning 5 anyways or ... wait till 6 is released

      Learn Perl right now because it will make your life better (assuming your life can be made better by a powerful scripting language/glue-layer from heck). Perl 6 is still far off on the horizon and Perl 5 knowledge will largely transfer to Perl 6.

      I can see the value in perl, and what a great tool it is, but for some reason i have a hard time wrapping my lil brain around it. It's a bit less "structured" or "consistent" than say C is.

      I think that setting out to learn Perl for its own sake will generally not work. One of Perl's strengths is that it grows with you and your needs. Learn a little bit of Perl and you still solve some very useful problems. For example, many people first learned Perl to do some quick-and-dirty projects like one-off data file reformatting, internal report generation, or simple CGI scripting. Learn more as you need it. It's taken me years to get to the point where I might call myself a skilled Perl hacker. But every step along the way was pleasant. I never felt I was learning stuff for the sake of learning stuff; I was always learning something that made my goals right now easier to achieve.

      Perl is about serving you, not you serving it.

    7. Re:Anyone who intimately knows 5 by cliveholloway · · Score: 3, Informative

      Start now. It's gonna be a while before six is out - and even longer before companies will trust it in production environments.

      And come over to The Monastery to get help when needed. A great resource for new (and experienced!) Perl hackers.

      .02

      cLive ;-)

      --
      -- Trinity in high heels carrying a whip: The donimatrix - there is no spoonerism
    8. Re:Anyone who intimately knows 5 by Phillup · · Score: 5, Insightful

      Over twenty years I've programmed with at least as many languages.

      So, I won't claim to know any language intimately.

      But... I have programed in Perl for the last five years. Why is simple.

      Because Perl let's me leverage the last 20 years of programming. If they see a good idea in another language... they put it in Perl.

      You will see a lot of people complain because of how Perl code looks. The simple fact is that you can write clean looking code... or ugly code. Perl doesn't care. It is your code... do it the way you want.

      Perl's strength is that it let's a programmer program the way they want to. That is also it's weakness.

      My advice would be to spend a few more years with a few other languages. You won't appreciate Perl until you know how elegantly it lets you solve some problems that you have used other tools for.

      If you are looking for "structure" and don't have the discipline to enforce it yourself... then stay away from Perl.

      --

      --Phillip

      Can you say BIRTH TAX
    9. Re:Anyone who intimately knows 5 by thogard · · Score: 4, Insightful

      The procedural stuff will remain the same. The OOD is getting a decent syntax and will no longer be a bolted on hack.

      Perl started life as shell script with a built in sed and awk. It has since grown.

      The regex stuff in perl 5 is just like sed and grep as far as new user is concerned. The simple regex stuff won't change with perl 6 and the concepts are the same. Perl 6 is going to change the shortcut symbols for the regex expressions.

      Perl5 have has a =~ operator that is going to get replaced with a ~~ operator. The ~~ will work in many places where the perl5 =~ won't work. This is part of the push to make perl more orthogonal.

      Perl6 will also deal with unicode out of the box with no real issues. Perl5's unicode was a bit of a hackjob as the coders learned along the way. Not that unicode is understood, it will be done right. Some of perl6 seems to be intended to get rid of bad practices based on the concept that "all the world is ascii". For example in Perl upto 6 you can say [a-zA-Z] to mean letters but that won't pickup up the latin-8 char set. Perl6is going to make it harder to say that and easy to say "Letters in the current language".

      The list processing may get to the point that it is on the same level as lisp.

      Perl6 appears to about about 18 months away so if your going to wait, its a long wait.

      Damian Conway gave a great talk on this just a few days ago. If you get a chance to hear him talk, take it.

    10. Re:Anyone who intimately knows 5 by Tablizer · · Score: 2, Funny

      The simple fact is that you can write clean looking code... or ugly code. Perl doesn't care. It is your code... do it the way you want.... Perl's strength is that it let's a programmer program the way they want to. That is also it's weakness.

      There are languages that would be fun if ONLY YOU yourself do all the writing, but the potential for abuse and bizzar variation is so great that I don't want to make a paid specialty in them, fearing that someday I will inherit spehgetti-and-sand-in-a-blender hell.

      Thus, I divide languages into "paycheck" languages and "fun" (or "hobby") languages. Reminds me of an old army story told by who knows. The sarge overheard one guy calling his rifle a "gun", which is a no-no at this base. So he forced the soldier to run around the compound naked holding his rifle in his right hand and his dick in his left, and he had to repeat, "This is my rifle, and this is my gun. One is for shooting, and the other for fun".

    11. Re:Anyone who intimately knows 5 by Phillup · · Score: 2, Insightful

      There are languages that would be fun if ONLY YOU yourself do all the writing, but the potential for abuse and bizzar variation is so great that I don't want to make a paid specialty in them, fearing that someday I will inherit spehgetti-and-sand-in-a-blender hell.

      If a company doesn't have the discipline to set and enforce coding standards, then the choice of language isn't going to be your biggest problem.

      IMHO

      --

      --Phillip

      Can you say BIRTH TAX
  11. Who would have thought! by Saeed+al-Sahaf · · Score: 5, Funny

    "hideously ugly" and "Perl" in the same paragraph? Who would have thought!

    --
    "Who are in control, they are not in control of anything - they don't even control themselves!" - Glen Beck
    1. Re:Who would have thought! by Naikrovek · · Score: 4, Insightful

      You guys...

      Perl, if written right, can be a VERY good looking, and VERY easy to understand. All of you that say that it is hard to read are:

      a) reading code that wasn't meant to be cute, but was meant to work where nothing else was as practical,
      b) reading code that was written by someone that didn't know perl, or are
      c) reading code written by someone that knows perl a LOT better than you.

      In my personal experience, people that gripe about Perl are the ones that use it least. The people I know that use Perl quickly learned to love it.

  12. Slashdotted. Here's the text by Bingo+Foo · · Score: 5, Funny

    Since the article is slashdotted, I have reprinted the text below:

    $_

    --
    taken! (by Davidleeroth) Thanks Bingo Foo!
    1. Re:Slashdotted. Here's the text by McCow · · Score: 5, Funny

      I can see what everyone is complaining about. Even jokes about Perl are hard to read.

    2. Re:Slashdotted. Here's the text by The+Ape+With+No+Name · · Score: 3, Funny

      use English; #DAMNIT!

      --
      Comparing it to Windows will be a moot point, since El Dorado is going to have a 40% larger code base than XP.
  13. Why was Perl5 so Popular? by use_compress · · Score: 4, Interesting

    With such bloated and obscure syntax in both the language and regular expressions, why do you think Perl 5 has become so popular? Once you've written a few programs in it, it is ULTRA EASY, ULTRA FAST and not hard to remember. An experienced Perl programmer could probablyl do almost any text processing task in a third of what it would take an expert C++ programmer to do. All of the bloat and lack of orthogonality and "bad design" paradoxically makes Perl 5 a fantastic language to program. I hope Wall doesn't mess this up...

    1. Re:Why was Perl5 so Popular? by deja206 · · Score: 2, Insightful

      AGREED.

      Actually, after using languages like Perl, PHP & Python, I started to question the reason why we need binaries.

      P.S. I'm yet to try out Ruby.

    2. Re:Why was Perl5 so Popular? by GigsVT · · Score: 2, Interesting

      Writing code is easy. Reading someone else's code is the real test.

      I stick to Bash for most things involving text processing.

      --
      I've had enough abrasive sigs. Kittens are cute and fuzzy.
    3. Re:Why was Perl5 so Popular? by Garin · · Score: 4, Insightful

      Definitely true. There is only one reason why Perl code is so frequently ugly:

      Perl exposes the mind of the programmer more directly than any other programming language.

      If you are more interested in quick hacks and dirty tricks than writing clean and manageable code, your perl will reflect that. If you are interested in impressing people by compressing seventeen operations into a single line of code, your perl will be an ugly, ugly thing.

      However, if your intention is to write clear, maintainable, understandable code, then this is what you will write. It isn't hard -- in fact I believe that Perl's flexibility makes this a much easier task than just about any other language. Here are a few of my favourite rules for Perl programmers:

      1) Just because you can, doesn't mean you should.

      2) One line of code means one operation or idea. MAAAAYBE 2. See point #1.

      3) If there is a cute, short, hackerish way to do something, and a longer, more boring, more explicit way to do the same thing, ALWAYS pick the boring way. Anyone who looks at your code in six months will be very pleased (instead of ready to kill you). Since Perl is so flexible, this is always possible. As for performance, well, in my experience the slick, hackerish ways of doing things often slow things down more than the explicit-using-more-lines way of doing things.

      --
      In any field, find the strangest thing and then explore it. -John Archibald Wheeler
    4. Re:Why was Perl5 so Popular? by miu · · Score: 2, Insightful
      An experienced Perl programmer could probablyl do almost any text processing task in a third of what it would take an expert C++ programmer to do.

      No expert C++ programmer would do a text processing task in C++. Most experienced programmers would use the scripting language they know best. They might write or use a module written in a compiled language if the task is more complicated than simple text munging.

      --

      [Set Cain on fire and steal his lute.]
    5. Re:Why was Perl5 so Popular? by WWWWolf · · Score: 2, Insightful

      Perl 5 does have its quirks. Yet, the quirks are hardly something that will make coding impossible. Even with its quirks, it's still a language that works just fine for what it does.

      Perl 5 reminds me of an almost regularly cleaned room. You can live there, stay for hours, there's a lot of cool stuff people have brought to the room... do everything you want and have fun. Just don't move the sofa because there's tons of dust under it.

      Perl 6 designers, then, are finding us a new room, move all old stuff from the old room there, and then ask the people where each of the things should be put or would the things look better a few meters to the left, perhaps. And they carry out all of the old newspapers and install one of those automated vacuum cleaners too.

  14. Too many cooks by ObviousGuy · · Score: 4, Interesting

    While no one would ever accuse Perl of being single minded and focused, until Perl5 it was a fairly coherent language.

    I understand that Perl6 is supposedly an evolution of the language, but there are so many suggestions for so many features and changes that the language itself seems to suffer from the too many cooks problem. With everyone and their brother suggesting features, the language itself becomes a mish mash of these features without a central theme tying it all together. Even if you said that DWIM was the central theme, can you really justify that when WIM is not what the language does because the feature that I'm using was designed by someone who had a completely different idea of what he meant?

    In the past Perl has added functionality that was useful and you can see where the language has its partitions. Base Perl (datatypes, simple arithmetic, simple string manipulation), nested datastructures, regexes, OO, and so on. While admittedly a mess, each addition to the language brought more power and ease. Perl6, OTOH, seems to be adding feature after feature without regard to whether it makes the language easier to use, only more powerful.

    So you end up with a new interpreter that won't run your old scripts without modifying the scripts. At the very least it should automatically default to Perl5 syntax unless otherwise told to use Perl6 syntax. Unfortunately, in the push to evolve, Larry and Damian (and the rest of the lunatics) have foregone automatic backwards compatibility.

    I'll probably migrate, but not for a while.

    --
    I have been pwned because my /. password was too easy to guess.
    1. Re:Too many cooks by kinsoa · · Score: 3, Informative

      there *is* a full backward compatibility : Parrot will run your Perl5 code. And if you don't want to run old perl5 code, there will be a script to convert your code.

      and you don't have to care about migration for now - not until the next two years. Perl6 is not ready.

      the "lunatics", as you said, seem to be very serious and competant...

  15. Hmmm by Moth7 · · Score: 4, Interesting

    IIRC it's possible to write OpenOffice macros in Perl (Though it probably takes some nasty hacked API to do it). And of course, given how easy it is to embed a Perl interpretter into C apps (possibly moreso with Parrot) then there's really no reason why it can't be used for game scripts.

    1. Re:Hmmm by __past__ · · Score: 5, Funny
      it's possible to write OpenOffice macros in Perl (Though it probably takes some nasty hacked API to do it)
      A nasty hacked API like, say, Perl, you mean?
    2. Re:Hmmm by Bingo+Foo · · Score: 2, Funny

      It's easy really: since the OO macro language is Turing complete, you just write a perl interpreter in OO macros.

      --
      taken! (by Davidleeroth) Thanks Bingo Foo!
  16. From the horse's mouth by ChaosDiscord · · Score: 5, Informative

    If you want the real scoop on the on-going planning of Perl 6, you might want to check out Larry Wall's Apocalypse articles: 1, 2, 3, 4, 5, 6. On the down side, they are dense. Very dense. For that reason, I actually recommend Daimon Conway's Exegesis articles: 2, 3, 4, 5, 6. They provide alot more context on what the changes actually mean to you and why they're good.

  17. A picture worth 1000 words by Nugget · · Score: 5, Funny
    1. Re:A picture worth 1000 words by ChaosDiscord · · Score: 3, Interesting

      Heh. Still, it's worth noting that this isn't new to Perl 6. Perl's always been a Chimera. Quoth the Perl man page (as it has as long as I can remember), "Perl combines (in the author's opinion, anyway) some of the best features of C, sed, awk, and sh, so people famil- iar with those languages should have little difficulty with it. (Language historians will also note some ves- tiges of csh, Pascal, and even BASIC-PLUS.)" As for why being a freakish blend and a giant mess is actually a feature, I suggest checking out Larry Wall's Second State of the Onion. (It's a long page, but the stuff on the advantages of complexity is all near the top.)

  18. why rev a language ? by ehack · · Score: 2, Insightful

    Exactly why does a properly designed language need core revisions every year ? I thought that was what libraries were for!

    --
    This is not a signature.
    1. Re:why rev a language ? by furry_marmot · · Score: 5, Interesting

      Because it's a high-level language with lots of sytactic sugar that made a whole new level of flexibility in programming. You can be loose, sloppy, tight, properly formatted, or write one-liners with equal ease.

      I agree with the main topic that other languages aspired to its expressiveness. The problem, from the point of view of a Perl hacker like me, is that some of them have actually outdone it, primarily by creating similar power, expressiveness, and simplicity but without being so ugly *and* being OO. Ruby and Python are pretty much the motivators for the upgrade.

    2. Re:why rev a language ? by J-Worthington · · Score: 2, Informative

      Maybe I'm missing your point, but Perl certainly isn't having core revisions every year in terms of the language. Perl5 has been around for about 10 years now, and will probably still be pretty widespread in another 5 years. 15+ years isn't a really bad lifetime for a langauge, and it isn't like there are no plans to continue support for Perl5 code. Indeed, they are currently re-implementing Perl5 on top of the Parrot engine, so Perl5 and Perl6 code will be able to interact. This means systems can gradually move from Perl5 to Perl6 if they need to, without needing a full re-write.

  19. Three cheers for Perl! by Chuck+Bucket · · Score: 4, Insightful

    Why do we use Perl every day? Because Perl scales to solve both small and large problems. Unlike languages like C, C++, and Java, Perl allows us to write small, trivial programs quickly and easily, without sacrificing the ability to build large applications and systems. The skills and tools we use on large projects are also available when we write small programs.

    I'm not a Perl hacker by any means, but after the possibilities are endless, and I don't think Perl will ever die.

    CB

    1. Re:Three cheers for Perl! by mortenmo · · Score: 5, Insightful

      But why would you want a language that can solve both small and large problems? Why not use a good language to solve "small problems" for "small problems", and a good language to solve "large problems" for "large problems"?

      Of course, I would probably argue that Perl cannot solve "large problems" after creating 100k+ line Perl applications. The problem lies that the reason languages like Perl is good for quick and dirty hacks is just the reason they are not that good for large systems that needs to be maintained over longer periods of time with many developers involved.

  20. Parrot embedded in a message thread by AubieTurtle · · Score: 2, Funny

    (perl[6] == "Great") || die;

  21. Re:Ruby... by vt0asta · · Score: 5, Insightful

    ...provides almost all of Perls power, with none of the ugliness... [emphasis mine]

    ...or the online documentation, the unit testing facilities, the CPAN repositories, the portablility, or the developer community.

    Sorry, but you had missed some things that Ruby has none of compared to Perl.

    --
    No.
  22. Ugly code by mr100percent · · Score: 4, Funny
    Neo: Do you always look at it heavily encrypted?
    Cypher: Oh that's not encryption... It's a new Perl script I'm working on...

    The Matrix Bastardization.

    1. Re:Ugly code by panck · · Score: 2, Funny

      Hmm, that suggests another programming language to join the ranks of brainfuck etc: the Matrix language.

      every line of your code contains 80 non-whitespace characters, most of which do nothing and are just there to look cool when streamed vertically in neon green against a black background. This way, when you scroll through your code, you're in the Matrxi!! Awesome!

      The only functional characters in the program are unicode glyphs that you can't find on a normal keyboard, everything else is treated as whitespace -- or rather, Matrix-space -- and actual whitespace characters don't exist, since in the future they have no need of them.

      --
      "What thou shalt not, I shalt did!" -Bart Simpson
  23. Quite possibly very naive question from a non-perl by FatRatBastard · · Score: 4, Interesting

    user...

    Is Parrot something akin to the JVM / .NET runtime engine? If so is the plan for it to be as robust as the JVM / .NET runtime: i.e. could the same type of applications that people are building for Java / .NET be just as easily built with Parrot?

    If I'm reading all of this right Parrot may well become everything Sun wants Java to become / MS wants .NET to become without the "what are those bastards going to do to the platform" stench.

    Of course, if I have the wrong end of the stick here I apologise. Perl isn't my strong suit.

  24. This parrot ain't dead by x3ro · · Score: 2, Interesting

    I'm amused to see that the name 'Parrot', originally coined for an April Fool's joke over at O'Reilly, has now been used to christen the bytecode interpreter for Perl 6. Life imitating art I guess.

    As for the 'extreme makeover' ... I hope it loses a bit of the excessive punctuation ...

    $broken ? fix($it) : s/!@#\$%\^\*//g if $ugly >= $all_hell;
    --
    [ UNSIGNED NOT NULL ]
  25. Maybe OT but I don't get it... by mkaltner · · Score: 5, Insightful

    Why does everyone say perl syntax is so damned ugly? Appearantly, they haven't seen C code written by someone with a "I'm a C God - Complex". I agree with some of the other posts here, it's only ugly if you have never used the language before. Write yourself a script or two and you quickly catch on.

    In fact, it's just like ANY other language (programming or spoken at that), it looks foriegn (go figure) until you put a little effort into it and figure it out.

    JM2C

    - Mike

    1. Re:Maybe OT but I don't get it... by rgmoore · · Score: 4, Insightful

      I think that a lot of the complaints about ugly code come from two things: excessive use of automatic variables like @_ and $!, and regexps. Reading automatic variables is something that comes with practice (Quick! Do you know what @+ is?) but reading regexps is likely to remain a problem until people start using /x (or Perl6) and comment them.

      --

      There's no point in questioning authority if you aren't going to listen to the answers.

  26. Re:Ruby... by Tyler+Eaves · · Score: 4, Informative

    You mean like:

    Doc

    http://www.ruby-doc.org/

    http://www.rubycentral.com/book/

    Unit Testing

    http://testunit.talbott.ws/

    http://www.rubygarden.org/ruby?RubyUnit

    Library Repository

    http://raa.ruby-lang.org/

    Portability
    Source compiles on anything vaugely Unix like

    Windows binaries available

    User Community
    comp.lang.ruby

    So, what were you on about again?

    --
    TODO: Something witty here...
  27. Re:No, Python by perlchimp · · Score: 5, Funny

    Java! -- Job Security!

    I am the lead developer on a 200K line commercial bioinformatics program written in Perl. That's job security.

  28. "Initial construction of the Internet" by Repton · · Score: 4, Informative
    Perl, a high-level programming language that was critical in the initial construction of the Internet, ...

    Perl was first released in 1987. Y'know, I could've sworn the internet already existed back then...

    (especially since Perl was released in a post to alt.sources)

    --
    Repton.
    They say that only an experienced wizard can do the tengu shuffle.
  29. Re:No, Python by Tyler+Eaves · · Score: 2, Interesting

    I used to use python a lot. Still do, really. I like it a lot.
    I just like ruby more. I find it easier to learn, even faster to code in, and language development is just as fast, if not faster than python.

    --
    TODO: Something witty here...
  30. Learn 5 first by Captain+Tripps · · Score: 2, Informative
    It's a safe bet that it'll be at least 18 months to a stable release for 6, and even longer before it gets significant adoption. From what I've read in the Apocalyses, the core part of the language will remain the same. (One of the goals for the redesign is "Perl should stay Perl.") Much of the new stuff is either extensions to the existing language or redesigns of advanced features like OO. Even for regular expressions, which have seen the most changes so far, Larry has emphasized that existing code can be adapted rather than rewritten.

    Finally, remember that most other Perl programmers will be in the same boat as you are in learning the new language, so Perl 5 should remain well supported for some time to come.

  31. Larry, please hurry by Ars-Fartsica · · Score: 4, Insightful
    The first Apocalypse was published in 2001. It is now 2004 and we are patient but perl 6 is starting to smell like vapor.

    Larry, you need to get an alpha out in 2004 (even if all of the Apocalypses have not been published) or I think you are going to see people lose interest in perl 6. In the time between Apocalypse 1 and today, the mono team have basically cranked out an entire development environment of excellent quality.

    Signed, an eight year perl programmer and major fan.

  32. for the naysayers.. by psycho_tinman · · Score: 5, Informative

    A few points to ponder ..

    You've all heard the "you can write unreadable code in any programming language" argument, so I'll spare you the repetition.. (No, wait.. I didn't, did I? ) *grin*

    But also bear in mind that Perl is the first language that I know of that used the foreach construct in the same form as the more sought after languages.. Java has iterators and enumerators, but they introduced a foreach because it is darn easy to understand.

    Perl innovated in regular expressions. Even Jeffery Friedl's Mastering Regex (sic) says that other languages aspire to be called "Perl 5 compatible" when they don't necessarily support all the features of Perl 5.6". Love it or hate it, regular expressions are like the microwave in your kitchen. Once you get used to it, it's darn hard to manage without :)

    I am not going to go into Perl 6 the moment it is released. But I guess that's ok, because I didn't adopt 5.8 the day it was released either. I just think that Larry Wall has made enough good calls in the language so far, to be worth trusting him for another version. Even one that promises to break some of the idioms that I am accustomed to in it's present incarnation. Hey, I didn't like Perl 5 when I first saw it either, but I notice the difference in my productivity when I got the hang of things.

    1. Re:for the naysayers.. by Anonymous Coward · · Score: 2, Interesting
      bear in mind that Perl is the first language that I know of that used the foreach construct

      man awk

    2. Re:for the naysayers.. by Virtex · · Score: 2, Insightful

      Also, man sh

      --
      For every post, there is an equal and opposite re-post.
  33. Re:The Parrot Vaporware Engine? by J-Worthington · · Score: 4, Informative

    I have a small involvement with Parrot (e.g. I've contributed a few small, insignificant things, mainly fixes for Win32). It's not vaporware, it's just that designing a stable, efficient, multi-threaded virtual machine that runs on a wide range of different platforms isn't an easy task. You can go and do a CVS checkout of Parrot now and play with some of the toy compilers, or if you use Windows grab yourself the Parrot On Win32 compiled version:-
    http://www.jwcs.net/developers/perl/pow /

    The 0.1 release may be coming by the end of this month - and if this release isn't 0.1, I'm pretty sure the next one will be. That means Parrot has objects, some of the threading stuff is in place, JIT is working on various platforms and more. There's a lot of hard work going in by a lot of very good developers (not me!), and I'm confident that Parrot will be completed and will be a hot target for dynamic languages.

  34. Say what? by rewt66 · · Score: 3, Insightful
    "Although Perl 5's expressions are the most sophisticated available and aspired to by other programming languages..."

    I can't believe that nobody's challenged this statement yet. Somehow I don't think that Lisp or Prolog aspire to Perl 5's expressions...

  35. Re:Ruby... by Anonymous Coward · · Score: 2, Funny

    Your post is like arguing that Duluth is New York's equal because they both have buildings.

  36. Perl brought this on itself by Artifakt · · Score: 2, Funny

    If Perl user's hadn't created the annual Obfuscated Perl contests, people wouldn't say such mean things about how the code looks ... Uh, no wait, isn't there one of those for C too? Well, if Perl had come along after the flaws in C++ were arround long enough to become really apparent, like Python ... Whaddya mean, it did? Uh, If Perl was distinguishable from line noise, people wouldn't say ugly, so there!

    --
    Who is John Cabal?
  37. QE4PG by Anonymous Coward · · Score: 2, Funny

    Extreme makeover, nah.

    Qeere Eye for the Perl Guy.

  38. Release date: 2020 by thelenm · · Score: 4, Insightful

    I was very excited about Perl 6 when Larry started releasing apocalypses. I really hate to say it, because I'm as big a fan of Perl as anyone... but at the current rate, we're not going to see a full specification (much less implementation) of Perl 6 anytime in the next 15 years. There have been 6 apocalypses in the past 3 years, and there are supposed to be about 30 in all.

    Perl has a long history of being practical and useful rather than theoretically perfect, and it makes me sad to see the trend reversing with Perl 6. It seems like Larry is trying to make Perl 6 everything to everyone. That's one sure way to fail (although TMTOWTDI, of course :-) It's just not useful to anyone if it doesn't exist.

    --
    Use Ctrl-C instead of ESC in Vim!
  39. Re:Perl... by vt0asta · · Score: 4, Informative

    No, I mean like:

    Doc

    Something a little more thorough.

    http://www.perldoc.com/

    Unit Testing

    Not just wrappers, but something a little more thorough and mature like say from executable to module.

    Unit Testing

    Library Repository

    http://raa.ruby-lang.org/
    ..pales in comparison to...

    http://www.cpan.org/

    Portability

    [Acorn] [AIX] [Amiga] [Apple] [Atari] [AtheOS] [BeOS] [BSD] [BSD/OS] [Coherent] [Compaq] [Concurrent] [Cygwin] [DG/UX] [Digital] [DEC OSF/1] [Digital UNIX] [DYNIX/ptx] [EMC] [Embedix] [EPOC] [FreeBSD] [Fujitsu-Siemens] [Guardian] [HP] [HP-UX] [IBM] [IRIX] [Japanese] [JPerl] [Linux] [LynxOS] [Macintosh] [Mac OS] [Mac OS X] [MachTen] [Minix] [MinGW] [MiNT] [MPE/iX] [MS-DOS] [MVS] [NetBSD] [NetWare] [NEWS-OS] [NextStep] [Novell] [NonStop] [NonStop-UX] [OpenBSD] [ODT] [OpenVMS] [Open UNIX] [OS/2] [OS/390] [OS/400] [OSF/1] [OSR] [Plan 9] [Pocket PC] [PowerMAX] [Psion] [QNX] [Reliant UNIX] [RISCOS] [SCO] [Sequent] [SGI] [Sharp] [Siemens] [SINIX] [Solaris] [SONY] [Sun] [Symbian] [Stratus] [Tandem] [Tru64] [Ultrix] [UNIX] [U/WIN] [Unixware] [VMS] [VOS] [Win32] [WinCE] [Windows 3.1] [Windows 95/98/Me/NT/2000/XP] [z/OS]

    User Community

    A little more world wide and established.

    http://www.pm.org/ ...in addition to the mailing lists.

    So, what were you on about again?

    From the parent parent parent poster. "Ruby has almost all of the power of Perl, with none of the ugliness" isn't quite a fair statement, considering Ruby is lacking or behind on almost everything else Perl is superior at. Ruby is still playing catch up, and depending on who you ask, can also be considered ugly.

    --
    No.
  40. Perl.... by silverhalide · · Score: 3, Funny

    ...is the duct tape of the internet.

  41. Parrot by steveha · · Score: 4, Informative
    I was intrigued by the news of Parrot, the interpreter core. It's a virtual machine, register-based rather than primarily stack-based as some other virtual machine cores have been. This is to take advantage of compiler technology.

    Long-term, Parrot hopes to be at the core of not just Perl 6, but also Python, FORTH, and what-have-you. Then applications could support Parrot, and users could script the applications in their favorite language. Python users could call into Perl CPAN code. That sort of fun thing.

    Parrot's home page is: http://www.parrotcode.org/

    The Parrot FAQ is worth reading. There are some really entertaining sections. One of my favorites:
    Why should I program in Parrot Assembly language?
    [...]
    You get all the pleasure of programming in assembly language without any of the requisite system crashes.


    Another:
    What language is Parrot written in?

    C.

    For the love of God, man, why?!?!?!?

    Because it's the best we've got.

    That's sad.

    So true. Regardless, C's available pretty much everywhere.


    So, my next question was: if they want to become the core of languages like Python, what does Guido van Rossum (the architect of Python) have to say about that? A few google searches later, and I found an interview at linuxfr.org, which contained this:
    DLFP: What do you think of the Parrot project (http://www.parrotcode.org/), which aim is to develop a common virtual machine for interpreted languages, such as Perl 6, Python, Ruby and Tcl ? [Jean-michel Fayard]

    Guido: I wish them well, but I don't think they will succeed. They are vastly underestimating the effort that goes into a virtual machine for any specific programming language. Even languages as similar as Ruby and Python have fundamentally different runtime abstractions, and the difference between Python and Perl is much greater still. (For example, the concepts of strings and numbers are entirely different in these two languages: in Python, numbers and strings are different immutable types, while in Perl they are the same type and are mutable.) I expect Parrot will do a great job of running Perl 6, but a relatively poor job of running other languages. Of course, I'd be happy if I were wrong (except for the brief moment of receiving a pie in the face at OSCON 2004), but I don't expect that to happen.

    steveha
    --
    lf(1): it's like ls(1) but sorts filenames by extension, tersely
  42. SNOBOL by Stephen+Samuel · · Score: 2, Interesting
    I haven't seen much of the new perl expressions lately, but they're gonna have to be pretty hot to beat what SNOBOL (spitbol) used to do,
    Spitbol could do things like:
    • stringtomatch "this is some text" skipto("(") $ pre_paren ( funcof(pre_paren)$parenmatch = replacement(parenpatch) )
    In this case, the $ is an immediate assignment of the match from skipto("(") (roughly equivalent to /([^(]*)/ . )
    funcof is then called with the newly assigned variable (pre_paren), and it's result is inserted as an expression to complete the match.
    then whatever matched funcof(pre_paren) is replaced by the results of replacement(parenmatch)

    skipto is a builtin, but funcof and replacement would have to be user-defined (and they can be defined on the fly).

    Perl6 appears to have similar functionality, but (IMHO) I don't think it's going to be quite as nice as the SNOBOL syntax.

    Unfortunately, I'm not good enough at compiler design to write my own spitbol interpreter, or I would.

    The one problem with snobol is that it was created before the idea of structured programming came along, so it is goto-structured... (although somebody then came up with ratbol which was essentially a preprocessor to provide RATional structure to snoBOL)

    --
    Free Software: Like love, it grows best when given away.
    1. Re:SNOBOL by Stephen+Samuel · · Score: 3, Interesting
      omigod... someone just (yesterday) released an up-to-date version of snobol I'm in patern-hacker's heaven.

      Oh, and just to keep on subject:
      SNOBOL is considered to be the parent of unix regexpressions and awk which led to Perl. Unfortunately, the children inherited a much castrated version of snobol's string manipulation capabilities which have only now been reasonably addressed in perl6.
      If nothing else, I suggest that people interested in the history of pattern matching take a good look at snobol.

      --
      Free Software: Like love, it grows best when given away.
  43. Re:Quite possibly very naive question from a non-p by J-Worthington · · Score: 4, Informative

    Parrot will be a virtual machine like the JVM and .NET runtime, yes. This means you can call functions and use objects from code written in the various different languages that target Parrot, compile stuff to bytecode that will run wherever Parrot will compile and more. Like .NET and JVM it uses JIT techniques to provide fast code execution.

    The main difference between Parrot and .NET/JVM is that they are more targetted towards statically typed languages. Languages like Perl, Python, etc that are likely to target Parrot are dynamic languages. This isn't just related to dynamic typing, but also to dynamic languages needing their parsers to be available at runtime. You can also do more stuff at runtime that non-dynamic languages would prefer you didn't. Parrot is designed with this in mind, which means it can offer these sorts of languages better performance.

    I have heard things along the lines of JVM and .NET bytecode to Parrot bytecode convertors, but I'm not sure how much speculation that is. I'm not really certain how easy it'd be, though my initial guess is "not very".

    Hope this answers some of your questions.

  44. Perl is a window into a programmers heart by Tikiman · · Score: 4, Insightful

    If the programmer is disciplined and well organized, the code will be disciplined and well organized. If the programmer doesn't value readability, then the code will not be readable. People like to take pot-shots at Perl, but they should really be aimed at Perl programmers.

  45. Re:python & ruby are fine,but they lack {}'s a by Queuetue · · Score: 2, Informative

    a) Ruby uses brackets or end statements to delineate blocks, not indentation.

    b) Why would anyone have a problem with this? Python code is remarkably easy to read and modify, primarily because there are no block delimiters to deal with. Maybe your editor is faulty?

  46. Ever heard of comments? by cliveholloway · · Score: 5, Interesting
    They're great. They help you to remember and comprehend code you wrote a while back. If you start a line with a "#" you can follow it with a comment.

    If you're looking at code *you wrote* for over an hour without understanding it, you only have yourself to blame. Unless you're coding in brainfuck, I suppose.

    tch

    cLive ;-)

    --
    -- Trinity in high heels carrying a whip: The donimatrix - there is no spoonerism
    1. Re:Ever heard of comments? by x3ro · · Score: 2, Insightful

      Comments are like crutches, or a band-aid. Healthy, readable code with sensible naming conventions and a clear structure doesn't need 'em.

      --
      [ UNSIGNED NOT NULL ]
    2. Re:Ever heard of comments? by Flashbck · · Score: 3, Insightful

      I agree that comments are like crutches, as I personally hate having to break my thought process to write a comment.

      On the other hand, even the most readable code takes time to look at and decypher. It is far easier to read that one line comment that you wrote last month and immediately recall what you were doing.

      Comments may be crutches, but I will always laugh at the idiot with the compound fracture in their femur who refuses to use a crutch to get around because he is too proud.

    3. Re:Ever heard of comments? by curunir · · Score: 4, Insightful

      I'd say Comments are more like Grandpa...

      He can tell you some really interesting stories about times you can't remember, but he slows you down immensely so he usually gets left at the old folks home while you try to get where ever you're trying to go.

      --
      "Don't blame me, I voted for Kodos!"
    4. Re:Ever heard of comments? by aiyo · · Score: 2, Interesting

      I dont write comments when writing code. I usually come back the next day and add comments. This way I remember what the code does, but also have given my self time to get out of the train of thought I had. Looking back I can more easily see if I have used bad programming style. Sometimes you just want to write the piece of shit and move on to something more interesting.

    5. Re:Ever heard of comments? by Mr_Silver · · Score: 2
      Comments are like crutches, or a band-aid. Healthy, readable code with sensible naming conventions and a clear structure doesn't need 'em.

      Actually comments are like sex. Even if they are bad, they're better than nothing.

      --
      Avantslash - View Slashdot cleanly on your mobile phone.
  47. Is this still Perl? by isomeme · · Score: 2, Insightful

    Larry Wall is a god, his core Perl dev team are demigods, and I'm very excited by all the goodies in Perl 6. But I have to wonder...if 6 is going to break so much existing code that it needs a hack to be backward compatible, why not just release a new language? What's the point of holding onto the name Perl but not the reality of running existing Perl code?

    --
    When all you have is a hammer, everything looks like a skull.
  48. Perl: A write only program language by xtronics · · Score: 5, Funny

    It is better to startover than to try and modify a perl script.

  49. Should be formatted thusly by Anonymous Coward · · Score: 3, Insightful

    Ninety nine percent
    of the Perl Haikus will not
    Apply anymore

  50. Python Resources. by Anonymous Coward · · Score: 3, Informative
    This is a list of what I consider to be the most useful Python packages. They give Python the ability to tackle almost any project.
    • Python - Get the Python interpreter, base libraries from here. The default install includes the IDLE editor.
    • Win32All - Windows extensions package that includes the excellent Pythonwin editor.
    • wxPython - Wrapper to the cross-platform wxWindows window manager library. It's a better windowing system than the TCL/TK library that is the default Python install.
    • Boa Constructor - GUI builder that uses the wxWindows library.
    • Psyco - x86 runtime compiler. Transparently improves the performance of most Python code - for performance-critical apps, it's often a much better solution than a C rewrite.
    • Py2Exe - Builds Python scripts into Windows executables. Perfect for distributing programs to systems that do not have Python installed. Use with Psyco for the best effect.
    • PyOpenGL - Use OpenGL from within Python
    • Python Image Library (PIL) - Package for easy image loading and manipulation
    • Plone - Web applications, built on top of the Zope framework.

    Abandon Perl! Python is the future!
  51. Design is What Matters by severoon · · Score: 2

    My opinion is that anything that makes programs to design is a Good Thing. One problem I've always had with Perl is that when you sit down to do something significant, you run into all kinds of options. An embarrassment of options, really. Options that allow you to do the same thing several different ways, so there's no reason to choose one way over another.

    This is what makes Perl so great for little knock-off scripts, but it can never be a serious contender for serious jobs because no two people have a reason to agree on how to accomplish any given complex task. Code readability is out the window. Transfer of knowledge goes down as TCO and maintainability goes up. The object of Perl's game was to provide an extremely terse way to do little things...but let's keep in mind that terseness only works to deal with the little problems.

    Having said that, if the new release can maintain Perl's legacy and give us a way to encapsulate terse solutions to small problems, but in a structured, regularized way, then we might just get the thing we need. Done correctly, any big problem can be sensibly solved in the new Perl by breaking it down into a bunch of little problems. Each little problem solved tersely, understandable on its own, connected together with a somewhat less-terse but sensibly high-level structure...sounds like most OO solutions to me and a good thing for Perl.

    sev

    --
    but have you considered the following argument: shut up.
  52. Quote-mania by OblongPlatypus · · Score: 3, Funny

    CmdrTaco wrote: "PurdueGraphicsMan writes "There's an article over at Yahoo! about the upcoming version of Perl (version 6) and some of the new features (RFC list). From the article: "Although Perl 5's expressions are the most sophisticated available and aspired to by other programming languages, "no one pretends for a moment that they're anything but hideously ugly," said Damian Conway, a core Perl developer and associate professor at Monash University in Australia."""

    Four levels of quotes; fun...

    --
    -- If no truths are spoken then no lies can hide --
  53. Re:No, Python by The+Ape+With+No+Name · · Score: 3, Funny

    If that sucker can output it's own code and send and e-mail too then, AND ONLY THEN, is it a true perl program.

    --
    Comparing it to Windows will be a moot point, since El Dorado is going to have a 40% larger code base than XP.
  54. perl is a swiss-army-knife by sir_cello · · Score: 2, Insightful


    What more to say ? Any real engineer has a "toolkit" of languages they use to put things together: I find "shell" to be glue, and "perl" to be rapid production of do-anything using CPAN modules. That's perl's niche.

  55. Performance by sbszine · · Score: 2, Interesting

    As for performance, well, in my experience the slick, hackerish ways of doing things often slow things down more than the explicit-using-more-lines way of doing things.

    Amen. I think this is because the interpreter / VM is usually optimised for the most obvious way of doing things. If you try and improve the performance of your code with tricks and shortcuts, you're basically trying to outsmart the Larry and the other internals hackers.

    --

    Vino, gyno, and techno -Bruce Sterling

  56. Re:python & ruby are fine,but they lack {}'s a by raytracer · · Score: 2, Interesting

    Here's an idea: get over it. It isn't that big of deal, and either choice is vastly more readable than perl.

    Let the flames begin!

  57. right...but by cliveholloway · · Score: 4, Insightful

    I'm not sure how "Healthy, readable code with sensible naming conventions and a clear structure" explains to you at a later date why you coded as you did. If you had to write something that looks out of place to deal with some legacy code you inherited, I'm sure you'd psychically pick that up just by glancing at the code. Or perhaps you go round naming vars something like $quirky_flag_to_pick_up_strange_situation_caused_b y_bad_code_in_package_X?

    And what if someone less experienced than yourself has to maintain your code at a later date? Something that may seem obvious to you may be off of their radar.

    If you never have to ask why and no one less intelligent than you ever looks at your code you either are very very lucky, very stupid or unemployed.

    .02

    cLive ;-)

    --
    -- Trinity in high heels carrying a whip: The donimatrix - there is no spoonerism
    1. Re:right...but by cliveholloway · · Score: 2, Informative

      The example i gave was off the top of my head. In the real world, for example, we've been dealing with a JavaScript HTML editor that has its own quirks (to say the least :). We do not have the time to learn enough OO javascript to perfect the code we're using. So we've had to hack how it works. Before presenting a page for edit, we have to remove certain elements and then re-insert them after edit. Without comments, we'd be returning to this code at a later date wondering *why* we're hacking it like this. Comments make it absolutely clear.

      In reality crap code is used a lot because of deadline pressure. But that doesn't make it OK.

      You're missing the point. If I can see what a coder *thought* they were doing, I can find their weaknesses easier and help them improve - rather than trying to second guess based purely on the code. I can spot inaccurate assumptions, illogical trains of thought and many other things that just don't jump out quickly from pure code.

      Even if I can read and understand what your code does, if an issue comes up that needs fixing quickly (say, a security issue affecting 60,000 web sites), I need to identify where the issue could be as quickly as possible. By reading comments along with the code, it's a lot easier to spot mistakes made by a developer.

      Here's another example. Let's say I'm chasing down a problem and I come to a regular expression that I think could be the issue. If the coder in question has commented it ( "Grab all URLs on the page that link to external sites", say) and I glance at the regular expression and see it doesn't do what the comment says it does, that sets alarm bells ringing. I can also gain an insight into what they were thinking when they coded the method.

      In an ideal world, everyone would cover every possible issue and everything would be watertight. But, in the real world, I'm often dealing with work by coders with different strengths and weaknesses. And it's a lot easier to coach them on their thinking if I have some idea as to what's going on in their head.

      I didn't mean to sound rude in my last post, but if you were working on my team, you would be expected to comment your code well. If you intend never to work with others and only maintain your own code, you could probably get away without commenting, but i wouldn't recommend it.

      A few months ago I spent 3 days working on what ended up being 20 lines of code that recursively built a menu for a Template Toolkit page from a DB table. Although from reading it, it makes sense, I commented *every* line of those 20, explaining why I did what I did and what issues I was coding to avoid - and what I hit along the way. Even now I find the notes useful. Or perhaps you think you'd remember how and why you created a hashref of arrayrefs of hashrefs of arrayrefs for the data structure - and how that fitted in with the particular template - instinctively?

      When taking on new team members (as we are at the moment :), I would be very wary of considering someone who doesn't comment.

      But that's just me. And what I've found works in building Perl apps over the last 7yrs :)

      cLive ;-)

      --
      -- Trinity in high heels carrying a whip: The donimatrix - there is no spoonerism
  58. Re:Perl... by vt0asta · · Score: 2, Informative

    Well, the only valid point on your list is the large selection of Perl libraries. But that's like saying Windows is better because thousands of programs are available..

    Not quite analagous, because that also means your definition of "better" for Ruby is like saying MacOS is better because there are fewer programs available.

    For instance, docs and unit testing are pretty much the same in Perl, Ruby, Python, PHP, Java...

    I must have screwed up my terminology. The unit testing I am referring to, is the built in stuff that comes with the Perl build process, the module build process, etc. Perl is second to none in testing. I would agree Perl, TCL, and Java docs are similiar in completeness. When I say complete, I mean documentation on how to embed and extend is available, is thorough, and all the intricacies are spelled out. Ruby, Python, and PHP are lacking. For example, at my command line I can type: perldoc perlxs, perldoc perlapi, perldoc perlembed, perldoc perlguts, and I have 10x more information about the innards and what is going on than the other languages.

    The Perl and Python communities are full of people trying to show off.. it gets old after a while.

    Not sure what you mean by show off. Ruby coders seem to be just as desperate as Python coders to demonstrate how their language is almost as powerful as Perl. When Ruby clutches the title of being the swiss army chainsaw in the industry, I think Ruby too, will have a reason to "show off".

    One great think about Ruby community though, is that it's still small and friendly.

    One awful thing about the Ruby community is that they pipe up about how they are almost as good as Perl whenever Perl is mentioned.. it's offtopic, untrue, and gets old after a while.

    --
    No.
  59. Debian by OverlordQ · · Score: 4, Funny

    *whew* Since I'm running Debian Stable I wont have to worry about learning Perl 6, till Perl 7 is ready to hit the shelves.

    --
    Your hair look like poop, Bob! - Wanker.
  60. Re:No, Python by perlchimp · · Score: 2, Interesting

    There are a lot of reasons but the short answers are regexes and the fact that non-programmers can get started quickly. Plenty of sharp minds think "If I could only sort throw this text and do this...." Perl lets them do that. You'd be amazed at the biology you can uncover with 50 lines of code and 50 megs of sequence. (If they don't 'use strict' though, plenty of comical things can happen.)

  61. OO Perl? by nounderscores · · Score: 2, Interesting

    I didn't even know it existed. What books/resources should I read if I'm going to stick with perl 5?

    1. Re:OO Perl? by Daerr · · Score: 2, Informative
    2. Re:OO Perl? by fanatic · · Score: 2, Informative
      Damian Conway has a book on Object Orienteed perl.

      The "Programming Perl" book voers it, as does (briefly) the "Perl Cookbook", which is a must-have.

      Most CPAN modules have an OO interface, so it's worth understanding at least a little of it.

      or were you just kidding and/or trolling?

      --
      "that's not encryption - it's a new perl script that I'm working on..." - from some Matrix parody
  62. Re:No, Python by Mr.+Pillows · · Score: 2, Interesting
    I am a bioinformaticist and I don't use perl that much. I have often wondered why perl was so popular myself. I think a lot of it has to do with the misconception that perl is the only language that works with text files. So maybe I should back up for a minute . . . there a part of computational biology that has to go through the uglies of working with raw data in files . . . thus the need to parse through them and reformat them.

    Almost every language has text processing capabilities. Here's a dirty little secret most people don't know . . . regular expressions for bioinformatics work is not as important as people would like you to believe. The fact of the matter is, most of the data bioinformatics researchers encounter is structured data. Simple string parsing and tokenization is all that is needed. Regulars expressions past the most simple are rarely encountered. In fact, a lot of the data a bioinformaticist encounters is in either XML, tab-delimited, or CSV. For the text processing part of my tasks, I have often used awk to blow my way right through a text file. Of course perl can do the same thing, but I'd like to point out that awk is great when so much of your data is in tabular format (we've got databases everywhere in this field). I also find Java's String, StringTokenizer, BufferedReader and Writer mixed with the FileReader and Writer classes to work great with text files too.

    This brings me to my last point. Perl is horrible for some areas of bioinformatics. A lot of people employed in so-called bioinformatics positions spend like 90% of their day parsing through text files. Most people don't know that there are bioinformaticists who spend very little of their day doing that, but instead are developing algorithms and such that usually require a different language. For instance, I'd hate to run a Hidden Markov modeler with the Viterbi algorithm coded in Perl :) Or how about a massive simulation during haplotype reconstructions in perl? Or maybe a support vector machine in perl? Hee, you get the idea. For these tasks C is often chosen. Particularly if one employs parallel programming. I encourage bioinformaticists to explore other languages besides perl so that they have a vast array of expression for the multi-facted charges a computational biologist is expected to handle.

  63. or you could just use the x modifier by cliveholloway · · Score: 4, Informative
    s/\s+ # at least one space<br>
    \( # open parenthesis<br>
    .*? # as few characters as possible<br>
    \) # close parenthesis<br>
    //gx; # perform on every line and allow comments in regex

    lameness filter won't let me space the comments neatly, but I'm sure you get the idea.

    .02

    cLive ;-)

    --
    -- Trinity in high heels carrying a whip: The donimatrix - there is no spoonerism
  64. Threads! by yem · · Score: 2, Informative

    Thank god threading is at the top of the list.

    I've been a perl programmer for six years - I still use it daily - but perl5's support for threading absolutely blows. There are plenty of modules for whipping together a multithreaded TCP server, but no reliable way to share a resource such as a database connection pool between those child threads. Have had to put at least one project on indefinite hold due to this failure.

    I assume its that oldskool anti-threading anti-OO attitude. Perl5 still isn't compiled with threading support by default and it breaks a tonne of modules and apps when it is.

    Perl6 can't get here soon enough.

    --
    No, I did not read the f***ing article!
  65. Beauty is in the eye of the beholder... by winkydink · · Score: 2, Insightful

    If it gets the job done efficiently, I couldn't care less how "ugly" the code looks.

    IMHO, Perl 6 is merely an employment continuation program for perl authors and training consultants. 5.8 doees more than everything I need and other languages fill in where perl is lacking (thr right tool for the right job and all).

    --

    "I'd rather be a lightning rod than a seismometer." -Ken Kesey

  66. Still uglier than *this* notation by j.leidner · · Score: 2, Interesting
    The new Perl regex notation might be slightly less horrible than the old one, but I think regular expressions are to be rejected altogether, as they make software un-maintainable.

    They should be replaced by something better, such as Xerox' Extended Regular Relation Calculus: Here are some examples.

    The nice thing about it is that it's fully declarative and bi-directional, i.e. a:b can be applied substituting a by b or vice versa (if run backwards), whereas the traditional

    if (/pattern/) { action; }
    pattern-action paradigm that Perl has inherited from awk is only partially declarative (only the pattern).

    Another interesting property is that xfst, one of Xerox' compilers, allows naming and re-use of subexpressions:

    define countryCode "++" [0-9]+ ;
    define areaCode "(" [0-9]+ ")" ;
    define endNumber [0-9]+ ("-" [0-9]+)
    define phoneNumber countryCode areaCode endNumber
    (all without any ugly '$'s :-)
    Abstraction by naming is a powerful feature, as Abelson and Sussman (SICP) and other good elementary textbooks point out.

    Maybe anybody wants to volunteed to build something like this into Perl6 instead?

  67. Re:No, Python by Etyenne · · Score: 2, Insightful

    My biggest Perl project is a 5KLOC Perl module. I don't know if that make me qualified to answer your question, but here's my 0.02$ : best practice for large-scale Perl program are the same as with any language. A few :

    1. Use descriptive name for variables, functions, objects, etc. Stick to a convention here.

    2. Also stick to a coding standard (brace style, ident, etc).

    3. Write good comment, but don't overdo it. Especially true for regexp, where you should describe what you want to match and what constraint you take into account.

    4. The most important: generalize as much of your code as possible into object or package.

    5. A corrolary of 4 is to re-use existing library. Search CPAN and prefer well-known package over more obscure one.

    The only Perl-specific advice I would have is to avoid obscure and lesser-known Perl construct such s compiled regexp, closure, use of local(), etc. If you do use one of these construct, explain the purpose of doing so in a comment, and give pointer to documentation on the subject if appropriate.

    --
    :wq