Become a fan of Slashdot on Facebook

 



Forgot your password?
typodupeerror
×
Perl Programming

Perl's Extreme Makeover 408

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.""
This discussion has been archived. No new comments can be posted.

Perl's Extreme Makeover

Comments Filter:
  • by Anonymous Coward on Thursday February 19, 2004 @06:44PM (#8333125)
    I'm not the person who posted that, but mr Mod, do you know what the fuck "redundant" means?

    Don't use words you can't understand
  • Expressions .. (Score:4, Insightful)

    by Billly Gates ( 198444 ) on Thursday February 19, 2004 @06:47PM (#8333148) Journal
    .. 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
  • The Parrot Engine? (Score:2, Insightful)

    by blcamp ( 211756 ) on Thursday February 19, 2004 @06:47PM (#8333150) Homepage

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

  • Re:Trolling, maybe (Score:5, Insightful)

    by irc.goatse.cx troll ( 593289 ) on Thursday February 19, 2004 @06:51PM (#8333207) Journal
    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.
  • Re:Expressions .. (Score:5, Insightful)

    by Xzzy ( 111297 ) <sether@@@tru7h...org> on Thursday February 19, 2004 @06:55PM (#8333257) Homepage
    > .. 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.
  • by ehack ( 115197 ) on Thursday February 19, 2004 @06:56PM (#8333279) Journal
    Exactly why does a properly designed language need core revisions every year ? I thought that was what libraries were for!
  • by Chuck Bucket ( 142633 ) on Thursday February 19, 2004 @06:57PM (#8333296) Homepage Journal
    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

  • by deja206 ( 711205 ) * on Thursday February 19, 2004 @06:58PM (#8333303) Homepage
    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...
  • Re:Ruby... (Score:5, Insightful)

    by vt0asta ( 16536 ) on Thursday February 19, 2004 @07:00PM (#8333334)
    ...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.

  • Re:Expressions .. (Score:1, Insightful)

    by Anonymous Coward on Thursday February 19, 2004 @07:00PM (#8333338)
    The thing about Perl is, it not only gives you enough rope to hang yourself with but also cheerfully builds you the gallows.

    It is absolute possible to write clean and elegant Perl code, but the dicipline to do so has to come from the programmer and is not inherent in the language. Perl's flexibility is both it's greatest strength and greatest weakness.

  • by mkaltner ( 555433 ) on Thursday February 19, 2004 @07:04PM (#8333373)
    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
  • by deja206 ( 711205 ) * on Thursday February 19, 2004 @07:04PM (#8333374) Homepage
    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.
  • by amplt1337 ( 707922 ) on Thursday February 19, 2004 @07:05PM (#8333385) Journal
    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 [rit.edu] 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.
  • by ChaosDiscord ( 4913 ) on Thursday February 19, 2004 @07:05PM (#8333387) Homepage Journal
    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.

  • Re:Expressions .. (Score:4, Insightful)

    by kfg ( 145172 ) on Thursday February 19, 2004 @07:06PM (#8333398)
    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
  • by mortenmo ( 95589 ) on Thursday February 19, 2004 @07:07PM (#8333410) Homepage
    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.
  • by Ars-Fartsica ( 166957 ) on Thursday February 19, 2004 @07:12PM (#8333483)
    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.

  • Re:Expressions .. (Score:5, Insightful)

    by Tony Hoyle ( 11698 ) <tmh@nodomain.org> on Thursday February 19, 2004 @07:16PM (#8333520) Homepage
    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.
  • Say what? (Score:3, Insightful)

    by rewt66 ( 738525 ) on Thursday February 19, 2004 @07:19PM (#8333554)
    "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...

  • Release date: 2020 (Score:5, Insightful)

    by thelenm ( 213782 ) <mthelen AT gmail DOT com> on Thursday February 19, 2004 @07:23PM (#8333611) Homepage Journal
    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.
  • Re:Ruby... (Score:1, Insightful)

    by Anonymous Coward on Thursday February 19, 2004 @07:23PM (#8333613)
    Oh puh leeze. RAA compares to CPAN like a glass of water compares to the ocean. CPAN has everything you can think of, and most of what you can't. Plus it has a pain free way of installing modules and following dependencies.

    And Ruby has documentation, sure... But nowhere near the amount that Perl does. I do man perl<tab> on my system, and there are 136 manpages available. And that's just manpages! What about perldoc? Plus there's just much more Perl stuff available online. You merely have to look.

    I actually really enjoy Ruby. I could almost see myself switching from Perl to Ruby, if a CPAN equivalent were available. I realize that Perl's had a few more years to accumulate modules, but frankly that's Ruby's problem, not mine.

    Until things I need are available on Ruby, I'm going to stick with Perl.
  • by Garin ( 26873 ) on Thursday February 19, 2004 @07:30PM (#8333694)
    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.
  • by Tikiman ( 468059 ) on Thursday February 19, 2004 @07:31PM (#8333700)
    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.
  • by Naikrovek ( 667 ) <jjohnson.psg@com> on Thursday February 19, 2004 @07:39PM (#8333808)
    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.
  • by rgmoore ( 133276 ) * <glandauer@charter.net> on Thursday February 19, 2004 @07:42PM (#8333848) Homepage

    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.

  • by miu ( 626917 ) on Thursday February 19, 2004 @07:45PM (#8333883) Homepage Journal
    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.

  • by WWWWolf ( 2428 ) <wwwwolf@iki.fi> on Thursday February 19, 2004 @07:52PM (#8333950) Homepage

    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.

  • by isomeme ( 177414 ) <cdberry@gmail.com> on Thursday February 19, 2004 @07:53PM (#8333960) Journal
    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?
  • by Phillup ( 317168 ) on Thursday February 19, 2004 @07:54PM (#8333966)
    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.
  • by Anonymous Coward on Thursday February 19, 2004 @07:54PM (#8333970)
    Ninety nine percent
    of the Perl Haikus will not
    Apply anymore
  • by halofan_sd ( 683327 ) on Thursday February 19, 2004 @07:55PM (#8333976)
    "In my personal experience, people that gripe about Perl are the ones that use it least" well duh, people that don't like perl obviously wouldn't use it much.
  • Re:Expressions .. (Score:5, Insightful)

    by consumer ( 9588 ) on Thursday February 19, 2004 @08:09PM (#8334134)
    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.).

  • by thogard ( 43403 ) on Thursday February 19, 2004 @08:10PM (#8334141) Homepage
    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.
  • by x3ro ( 628101 ) on Thursday February 19, 2004 @08:26PM (#8334317) Homepage
    Comments are like crutches, or a band-aid. Healthy, readable code with sensible naming conventions and a clear structure doesn't need 'em.
  • by sir_cello ( 634395 ) on Thursday February 19, 2004 @08:28PM (#8334335)

    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.
  • by Anonymous Coward on Thursday February 19, 2004 @08:30PM (#8334355)
    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 :)

    Yes.

    bash-2.03$ vim test.pl
    bash: vim: command not found
    bash-2.03$ vi test.pl
    linux: Unknown terminal type

    [Using open mode]
    Segmentation Fault
    bash-2.03$ TERM=vt100 vi test.pl #Bingo!
    #!/usr/bin/perl

    use warnings;
    use strict;

    print "Solaris uses an old Perl.\n";
    bash-2.03$ ./test.pl
    Can't locate warnings.pm in @INC (@INC contains: /usr/perl5/5.00503/sun4-solaris /usr/perl5/5.00503 /usr/perl5/site_perl/5.005/sun4-solaris /usr/perl5/site_perl/5.005 .) at ./test.pl line 3.
    BEGIN failed--compilation aborted at ./test.pl line 3.
  • right...but (Score:5, Insightful)

    by cliveholloway ( 132299 ) on Thursday February 19, 2004 @08:54PM (#8334566) Homepage Journal

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

  • by Virtex ( 2914 ) on Thursday February 19, 2004 @09:04PM (#8334638)
    Also, man sh
  • by Flashbck ( 739237 ) on Thursday February 19, 2004 @09:07PM (#8334682)
    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.
  • by Phillup ( 317168 ) on Thursday February 19, 2004 @10:03PM (#8335277)
    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

  • by curunir ( 98273 ) * on Thursday February 19, 2004 @10:08PM (#8335326) Homepage Journal
    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.
  • by layingMantis ( 411804 ) on Thursday February 19, 2004 @11:01PM (#8335765) Homepage
    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.
    br>Um, dude, you do realize that in the real world this is the situation 90% of the time? Code is generally used for a practical purpose, as far as I know.

    Juvenile Court to Try Shooting Defendant
    So like is there a certain lines per minute threshold at which one can enjoy Perl?
  • by sumengen ( 230420 ) on Thursday February 19, 2004 @11:57PM (#8336160)
    What's the point of giving a regular expression example? C# has the exact same regex syntax, as others (uglier actually).
  • by perljon ( 530156 ) on Friday February 20, 2004 @12:06AM (#8336239) Homepage
    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 [perl.com] for more info.
  • by Anonymous Coward on Friday February 20, 2004 @02:27AM (#8337138)
    I just took a job at a shop that accumulated 2 years of perl hacks to run a e-com engine based on text files.

    They tried to "invest" in its two perl programmers to port the thing to Java. They wrote a very nice verbatim translation, relying on hashmaps and java regexp libraries and making a mockery of their objects, simply using them as ill-named procedural labyrinths.

    You can be ugly in any language.

    The only reason I prefer java is that its easier to enforce conventions, encapsulation, OO, etc., so as we ramp up with additional programmers, I won't have to worry as much about noodles of crap.

    I'm sure I can do any single programming task faster in perl, but over the long haul with a potentially rotating cast of programmers, java, combined with better design, will make everyone's jobs easier.

    Or i'm talking out of my axe and I'm just the next pulper in line.

  • by winkydink ( 650484 ) * <sv.dude@gmail.com> on Friday February 20, 2004 @03:56AM (#8337516) Homepage Journal
    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).
  • by aerique ( 206 ) on Friday February 20, 2004 @05:57AM (#8337861) Homepage
    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

  • Re:No, Python (Score:3, Insightful)

    by Etyenne ( 4915 ) on Friday February 20, 2004 @10:51AM (#8339217)
    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.

You knew the job was dangerous when you took it, Fred. -- Superchicken

Working...