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

Re: (Golf) Segfault Perl

by Juerd (Abbot)
on Apr 03, 2002 at 22:49 UTC ( [id://156476]=note: print w/replies, xml ) Need Help??


in reply to (Golf) Segfault Perl

#234567 undef a

Strokes: 7
Penalty: 8 (win32, openbsd, hp-ux, mac)

Score: 15

Update - Does this only segfault on Linux systems? I thought I had a nice score, but the penalties are killing me :)

U28geW91IGNhbiBhbGwgcm90MTMgY
W5kIHBhY2soKS4gQnV0IGRvIHlvdS
ByZWNvZ25pc2UgQmFzZTY0IHdoZW4
geW91IHNlZSBpdD8gIC0tIEp1ZXJk

Replies are listed 'Best First'.
(MeowChow) Re2: (Golf) Segfault Perl
by MeowChow (Vicar) on Apr 03, 2002 at 23:23 UTC
    Then it looks like we're tied:
      
    #23456789 *::=%::=0
    unless, of course, someone can find a well behaving platform for this :)
       MeowChow                                   
                   s aamecha.s a..a\u$&owag.print

      Ahem.

      $ perl -e '*::=%::=0' Modification of a read-only value attempted at -e line 1. $ perl -v This is perl, version 5.005_02 built for PA-RISC1.1
      Now I don't feel so bad about dinging Juerd. ;-)

      Just call me StrokeReaper.

      Update
      As MeowChow and Chmrr both pointed out, the rules stipulate 5.6.1. No penalty.

        Err -- "5.005_02" ne "5.6.1" The rules state that we're only talking about version 5.6.1.

        perl -pe '"I lo*`+$^X$\"$]!$/"=~m%(.*)%s;$_=$1;y^`+*^e v^#$&V"+@( NO CARRIER'

      perl -e '*::=%::=0'
      Bus error(coredump)

      perl -e 'undef a'
      Can't modify constant item in undef operator...

      perl -v
      This is perl, v5.6.1 built for IA64.ARCHREV_0-thread-multi
      Binary build 631 provided by Activestate

      I'll let the judges decide whether this was truly a valid test since the HW is still in the experimental stage. (Itanium running HP-UX 11.22)

        I'll let the judges decide whether this was truly a valid test since the HW is still in the experimental stage. (Itanium running HP-UX 11.22)

        Please send me your hardware so I can verify these results and "decide"! ;)

           MeowChow                                   
                       s aamecha.s a..a\u$&owag.print
Re: Re: (Golf) Segfault Perl
by VSarkiss (Monsignor) on Apr 03, 2002 at 23:07 UTC

    Sorry, two-stroke penalty. It doesn't segfault under Win32:

    C:\>perl -e "undef a" Can't modify constant item in undef operator at -e line 1, at EOF Execution of -e aborted due to compilation errors. C:\>perl -v This is perl, v5.6.1 built for MSWin32-x86-multi-thread (with 1 registered patch, see perl -V for more detail) Copyright 1987-2001, Larry Wall Binary build 628 provided by ActiveState Tool Corp. http://www.ActiveS +tate.com Built 15:41:05 Jul 4 2001
    I just realized your sig is longer than your golf program. ;-)

    Update
    Sorry Juerd, the penalty is four strokes. No segfault under 5.00502 on HP-UX either:

    $ perl -e 'undef a' Can't modify constant item in undef operator at -e line 1, at EOF Execution of -e aborted due to compilation errors. $ perl -v This is perl, version 5.005_02 built for PA-RISC1.1 Copyright 1987-1998, Larry Wall
    Now I'm starting to feel bad....

    Update 2
    Whoops! The rules did specify 5.6.1. My bad. Just two strokes off, then.

Re: Re: (Golf) Segfault Perl
by smgfc (Monk) on Apr 04, 2002 at 22:17 UTC
    Sorry, there is another two stroke penalty. It doesn't work on MacPerl! And by "doesn't work" i mean it does work. And by "does work" I mean "doesn't work". Just to clarify it doesn't crash MacPerl, but MacPerl does kick me when I try to run it! Good code though. And by "Good Code" ... :)
(MeowChow) Re2: (Golf) Segfault Perl
by MeowChow (Vicar) on Apr 04, 2002 at 01:24 UTC
    Hmm, this doesn't seem to segfault OpenBSD either.
       MeowChow                                   
                   s aamecha.s a..a\u$&owag.print
Re: Re: (Golf) Segfault Perl
by abstracts (Hermit) on Apr 06, 2002 at 01:58 UTC
    [11]: perl -e 'undef a' [12]: perl -v This is perl, v5.6.1 built for sun4-solaris
    nice try though :-)

Log In?
Username:
Password:

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

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

    No recent polls found