Ovid has asked for the wisdom of the Perl Monks concerning the following question:

Having never used 5.6, I have not paid much attention to the differences between it and 5.005. However, we've had some problems at work where our IS director is using 5.6 and others are not. He'll hack out a script, ask me to test it, and things go downhill from there. I've chatted with him about this and agreed to look into the differences between the two and make a recommendation. I'm going to read up on 5.6, but I'd like to get the impressions from fellow Monks as to whether or not switching to 5.6 is worthwhile. I've heard that it's buggy, but perl.com always has that "Perl Versions: Stable is 5.6.0." notice at the top of their main page.

We are using this primarily for CGI scripts, using MS SQL Server 7.0 on an NT network with IIS. (And ActiveState Perl, of course).

Cheers,
Ovid

Replies are listed 'Best First'.
Re: 5.6 versus 5.005
by gnat (Beadle) on Sep 02, 2000 at 04:25 UTC
    The bugs that I remember being described in 5.6 are:
    • Some odd regexp bugs caused by the new RE engine. The situations they cropped up in seemed to be rare, but a few people (5ish?) reported running into them.
    • CPAN modules with XS components, that had already been installed, sometimes wouldn't work. I believe the solution was to rebuild the module or to rebuild Perl with an option. I can't remember which.
    • Unicode support is only half-there for string operations (which shouldn't break much, seeing as how there was no Unicode support in 5.005 :-)
    • The lexical warnings stuff never seemed to work for me ("no warnings" didn't stop warnings).
    My advice is to stay at 5.005_03 until 5.6.1 comes out, simply because installing a new version of Perl *always* is a pain in the butt, even when it goes smoothly. It's work you don't want to have to do twice, a month apart.

    5.6 has a whole lot of sexy new features:

    • Autovivifying file handles. No more screwing with typeglobs, if you want to open a filehandle and store the filehandle in a scalar:
      open my $fh, "< foobar" or die;
    • 3-arg open to separate file mode from filename:
      open my $fh, "<", $filename or die;
    • POSIX character classes, and extensions to the POSIX character classes.
    • Unicode everywhere. Coolest is \N in double quoted strings for named characters: "I \N{heavy-black-heart} Perl" and Unicode character properties.
    • our() keyword, a lexically-scoped version of "use vars".
    • version strings, a way to make binary strings that can hold byte tuples:
      $str = v3.14; $str = 12.1.128.19; # v not needed if multiple dots
    • threading is damn near usable (everything but $1 et al works with threads, I believe). People have actually been using it.
    • compiler is closer, but still needs work.
    • BEGIN and END have friends, CHECK and INIT. CHECK blocks are done as last step of compilation phase. INIT blocks are done as first step of execution phase.
    • warnings module lets you enable and disable warnings for a block, also lets your module specify categories for the warnings it issues.
    • lvalue subroutines:
      foo() = 5; print foo(); foo() *= 2; print foo();
      It's a subroutine that returns a value, but you can change that value!
    I wrote the "what's new in 5.6" section of a new class, "Advanced Topics In Perl", so it's all fresh in my mind :)

    Cheers;

    Nat

Re: 5.6 versus 5.005
by chromatic (Archbishop) on Sep 01, 2000 at 22:00 UTC
    If there's something new in 5.6 that you really need, switch. Otherwise, wait for 5.6.1 (which I've heard will be out soon enough).

    In my case, I don't need the new features (lvalue subs, extra Unicode goodies, but the 'our' keyword would be nice), so I'm happy with 5.5.3.

    On new ActiveState installations (on Windows for clients), I've used 5.6 (ActiveState 613 or something like that) with no heartache.

Re: 5.6 versus 5.005
by KM (Priest) on Sep 01, 2000 at 21:41 UTC
    Of course, you can find out changes by reading perldelta. As for 5.6, I also have heard of the bugs and such and believe 5.7.0 (which will be a development release) is comming RSN. Maybe it would be good to wait and see what bug fixes are in 5.7.0, or just wait until 5.8. Thus far, I have stuck with 5.005 for all production code.

    Cheers,
    KM

      5.7 is supposed to be released any time now. Some patches will be removed and that will become 5.6.1.

      I recommend waiting for 5.6.1. I also recommend that your developers stay at the lowest version in use so that they do not accidentally use features that will force others to upgrade.

      AMEN!!!
RE: 5.6 versus 5.005
by lindex (Friar) on Sep 02, 2000 at 02:15 UTC
    50% of all the code I have posted here was written under 5.6
    The other 50% wasnt but runs fine under 5.6
    I have yet to notice any real differences, and noone seems to be complaining.
    just throwing in my input :)
    -L


    lindex
    /****************************/ jason@gost.net, wh@ckz.org http://jason.gost.net /*****************************/
Re: 5.6 versus 5.005
by SuperCruncher (Pilgrim) on Sep 02, 2000 at 03:15 UTC
    <rant> I really wish web hosting providers and shell account providers would upgrade to 5.6. It is really annoying have to put up with tons of syntax errors. </rant>

    Anyway, 5.6 introduces our() declares in addition to my() which, as far as I know, removes the need for use vars or whatever ugly mechanism global vars were achieved by previously.

    I've also had

    print for @foo;
    throw up tons of errors in older versions of Perl, and having to change this to
    for (@foo) { print; }
    is a pain, needless to say. As others have mentioned, 5.6 also includes Unicode capabilities which is interesting. BTW, on a vaguely off-topic note, is anyone else seriously looking forward to when the whole DNS system uses unicode?
Re: 5.6 versus 5.005
by Anonymous Monk on Sep 01, 2000 at 22:27 UTC
    I'm not sure what they changed, but I know it broke the version of latex2html we were running where I work. We had to change every

    undef(A,B,C)

    to

    undef(A);undef(B);undef(C);
      Regardless of the behavior undef may have exibited previously, the 5.005_3 perlfunc says explicitly-- Note that this is a unary operator, not a list operator.

      The current perldelta also mentions the correction of this "accidental" behavior.

(Anonymous monk) Re: 5.6 versus 5.005
by Anonymous Monk on Sep 02, 2000 at 03:32 UTC
    Hey, just wanted to say "Thanks!" to all of you for the input (and keep it coming).

    Cheers,
    Ovid (who posts anonymously to avoid gratuitous ++ votes for a stinkin' "thank you" note)