Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

5.8.1 Released!

by liz (Monsignor)
on Sep 25, 2003 at 12:10 UTC ( [id://294139]=perlnews: print w/replies, xml ) Need Help??

          "What happens next?" asked Twoflower.

        Hrun screwed a finger in his ear and inspected it absently.

          "Oh,", he said, "I expect in a minute the door will be
        flung back and I'll be dragged off to some sort of temple
        arena where I'll fight maybe a couple of giant spiders
        and an eight-foot slave from the jungles of Klatch and then
        I'll rescue some kind of a princess from the altar and then
        I'll kill off a few guards or whatever and then this girl
        will show me the secret passage out of the place and we'll
        liberate a couple of horses and escape with the treasure."
        Hrun leaned his head back on his hands and looked at the
        ceiling, whistling tunelessly.

          "All that?" said Twoflower.

          "Usually."

                        -- Terry Pratchett,
                          "The Colour of Magic"

Grab it:

	http://www.cpan.org/authors/id/J/JH/JHI/perl-5.8.1.tar.gz

perldelta:

	http://www.hut.fi/~jhi/perldelta-5.8.1.html

Replies are listed 'Best First'.
defined or: // and //=
by liz (Monsignor) on Sep 25, 2003 at 15:14 UTC
    For those of you who cannot wait until 5.10 and/or Ponie to be able to use "defined or", H. Merijn Brand has uploaded the necessary source patches. When you apply this patch to the 5.8.1 source tree, you get a new operator // (defined-or). This allows you to say
    $a // $b
    instead of
    defined $a ? $a : $b
    and
    $c //= $d;
    instead of
    $c = $d unless defined $c;
    The operator has the same precedence and associativity as ||.

    H. Merijn Brand uses this in his production environments for quite some time already, so it appears to be pretty stable. Of course, using this operator will make your code unportable to "standard" Perl 5.8.1, so YMMV.

    Liz

      I for sure will start using // and //=. Already installed 5.8.1 plus two patching, including the defined-or patch on both my home and work boxes.

      And in case you want to know what the other patch is, it gets rid of the blasted "print (...) interpreted as function" warning.

      Abigail

Re: 5.8.1 Released!
by rob_au (Abbot) on Sep 25, 2003 at 13:11 UTC
    map in void context is no longer expensive. map is now context aware, and will not construct a list if called in void context.

    No longer can monks be admonished for employing map in a void context, building a list and discarding it! The faq_monk may need to be updated.

    :-)

     

    perl -le "print+unpack'N',pack'B32','00000000000000000000001010000111'"

      map in void context is no longer a sin, but still it can't be used lightly instead of for, which is 25% faster than map.

      It has been a great improvement from previous versions, though.

      use Benchmark; print "Perl $]\n"; timethese (10000,{ "map"=> sub { map { $_ } ( 1 .. 1000 ) }, "for"=> sub { $_ for ( 1 .. 1000 ) } } ); __END__ Perl 5.006001 Benchmark: timing 10000 iterations of for, map... for: 3 wallclock secs ( 2.81 usr + 0.00 sys = 2.81 CPU) map: 5 wallclock secs ( 5.16 usr + 0.01 sys = 5.17 CPU) Perl 5.008 Benchmark: timing 10000 iterations of for, map... for: 3 wallclock secs ( 2.19 usr + 0.01 sys = 2.20 CPU) map: 4 wallclock secs ( 4.65 usr + 0.02 sys = 4.67 CPU) Perl 5.008001 Benchmark: timing 10000 iterations of for, map... for: 2 wallclock secs ( 1.72 usr + 0.00 sys = 1.72 CPU) map: 2 wallclock secs ( 2.27 usr + 0.02 sys = 2.29 CPU) Perl 5.008001 Benchmark: timing 50000 iterations of for, map... for: 9 wallclock secs ( 8.71 usr + 0.01 sys = 8.72 CPU) map: 12 wallclock secs (11.53 usr + 0.04 sys = 11.57 CPU)
        Well, now you are comparing map/block with for/expression. Blocks are more expensive than expressions. And while this doesn't mean for isn't slightly faster than map, it does skew the results. Here's another benchmark, where we do a very simple thing in the block/expression:
        #!/usr/bin/perl use strict; use warnings; use Benchmark 'cmpthese'; cmpthese -2 => { map_block => sub {my $s = 0; map {$s +=$_} 1 .. 1000; $s}, for_block => sub {my $s = 0; for (1 .. 1000) {$s += $_}; $s}, map_expr => sub {my $s = 0; map $s += $_ => 1 .. 1000; $s}, for_expr => sub {my $s = 0; $s += $_ for 1 .. 1000; $s}, } __END__ Rate map_block map_expr for_block for_expr map_block 3224/s -- -4% -10% -17% map_expr 3345/s 4% -- -6% -14% for_block 3572/s 11% 7% -- -8% for_expr 3900/s 21% 17% 9% --

        map is slower than for, but the difference is in the same order as the difference between a for/expression and a for/block.

        Abigail

      Yeah, I got that perldelta remark in just in time. ;-)

      Abigail

Re: 5.8.1 Released!
by castaway (Parson) on Sep 25, 2003 at 13:54 UTC
    A Windows version compiled on win2k:
    Download

    perl -V:

    Summary of my perl5 (revision 5 version 8 subversion 1) configuration: Platform: osname=MSWin32, osvers=4.0, archname=MSWin32-x86-multi-thread uname='' config_args='undef' hint=recommended, useposix=true, d_sigaction=undef usethreads=undef use5005threads=undef useithreads=define usemultip +licity=define useperlio=define d_sfio=undef uselargefiles=define usesocks=undef use64bitint=undef use64bitall=undef uselongdouble=undef usemymalloc=n, bincompat5005=undef Compiler: cc='cl', ccflags ='-nologo -Gf -W3 -MD -DNDEBUG -O1 -DWIN32 -D_CON +SOLE -DNO_ STRICT -DHAVE_DES_FCRYPT -DPERL_IMPLICIT_CONTEXT -DPERL_IMPLICIT_SYS +-DUSE_PERL IO -DPERL_MSVCRT_READFIX', optimize='-MD -DNDEBUG -O1', cppflags='-DWIN32' ccversion='', gccversion='', gccosandvers='' intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=1234 d_longlong=undef, longlongsize=8, d_longdbl=define, longdblsize=10 ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='__int64 +', lseeksi ze=8 alignbytes=8, prototype=define Linker and Libraries: ld='link', ldflags ='-nologo -nodefaultlib -release -libpath:"c:\ +perl5.8.1\ lib\CORE" -machine:x86' libpth="C:\Program Files\Microsoft Visual Studio\VC98\lib" libs= oldnames.lib kernel32.lib user32.lib gdi32.lib winspool.lib + comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib netap +i32.lib uuid.lib wsoc k32.lib mpr.lib winmm.lib version.lib odbc32.lib odbccp32.lib msvcrt. +lib perllibs= oldnames.lib kernel32.lib user32.lib gdi32.lib winspool +.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib n +etapi32.lib uuid.lib wsock32.lib mpr.lib winmm.lib version.lib odbc32.lib odbccp32.lib msv +crt.lib libc=msvcrt.lib, so=dll, useshrplib=yes, libperl=perl58.lib gnulibc_version='undef' Dynamic Linking: dlsrc=dl_win32.xs, dlext=dll, d_dlsymun=undef, ccdlflags=' ' cccdlflags=' ', lddlflags='-dll -nologo -nodefaultlib -release -l +ibpath:"c: \perl5.8.1\lib\CORE" -machine:x86' Characteristics of this binary (from libperl): Compile-time options: MULTIPLICITY USE_ITHREADS USE_LARGE_FILES PERL +_IMPLICIT_ CONTEXT PERL_IMPLICIT_SYS Built under MSWin32 Compiled at Sep 25 2003 14:54:37 @INC: c:/perl5.8.1/lib c:/perl5.8.1/site/lib .
    (Never compiled on Windows before.. nmake test said 100% ok, not tested beyond that..)

    (Courtesy of castaway, theorbtwo and mastros.biz)

Re: 5.8.1 Released!
by liz (Monsignor) on Sep 25, 2003 at 12:27 UTC
    I think Jarkko has (again) done a marvellous job getting a major Perl version out of the door. The pressure of adding still more fixes and more fixes was big, but at some point a cut-off has to be made. There will always be more problems. And newer versions.

    I would like to wish Jarkko a well earned vacation!

    Liz

Re: 5.8.1 Released! (Win32/Borland patches)
by BrowserUk (Patriarch) on Sep 26, 2003 at 00:06 UTC

    If anyone wants to build this for win32 with Borland, these patches allow the use of USE_PERLIO and USE_LARGE_FILES.

    dosish.h

    win32.c

    win32sck.c

    They have been submitted to p5p, but will obviously take sometime to filter into a full release. They don't cause any additional "make test" failures and I believe I've exercised the large file support fairly thoroughly.


    Examine what is said, not who speaks.
    "Efficiency is intelligent laziness." -David Dunham
    "When I'm working on a problem, I never think about beauty. I think only how to solve the problem. But when I have finished, if the solution is not beautiful, I know it is wrong." -Richard Buckminster Fuller
    If I understand your problem, I can solve it! Of course, the same can be said for you.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlnews [id://294139]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others studying the Monastery: (5)
As of 2024-04-19 15:52 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found