Subject: RE: [hackers-il] Perl Golf

From: Tal Rotbart <[email-masked]>
Date: Wed, 28 May 2003 17:01:18 +0300

Eeek that's some ugly code :)

-----Original Message-----
From: Shlomi Fish [mailto:[email-masked]] 
Sent: Wednesday, May 28, 2003 4:59 PM
To: Hackers-IL
Subject: Re: [hackers-il] Perl Golf

And here's a classic snippet to print "Prime" if a number is prime:

perl -wle 'print "Prime" if (1 x shift) !~ /^1?$|^(11+?)\1+$/'

Taken from:

http://ucan.foad.org/~abigail/Perl/Talks/Japhs/primes2.html

Regards,

	Shlomi Fish

----------------------------------------------------------------------
Shlomi Fish        [email-masked]
Home Page:         http://t2.technion.ac.il/~shlomif/

An apple a day will keep a doctor away. Two apples a day will keep two
doctors away.

	Falk Fish

------------------------ Yahoo! Groups Sponsor ---------------------~--> Get
A Free Psychic Reading! Your Online Answer To Life's Important Questions.
http://us.click.yahoo.com/Lj3uPC/Me7FAA/CNxFAA/saFolB/TM
---------------------------------------------------------------------~->

To unsubscribe from this group, send an email to:
[email-masked]

Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/ 

________________________________________________________________________
This email has been scanned for all viruses. 

Mercury Interactive Corporation
Optimizing Business Processes to Maximize Business Results

http://www.merc-int.com
________________________________________________________________________

________________________________________________________________________
This email has been scanned for all viruses. 

Mercury Interactive Corporation
Optimizing Business Processes to Maximize Business Results 

http://www.merc-int.com
________________________________________________________________________

---

From: Shlomi Fish <[email-masked]>
Date: Wed, 28 May 2003 19:26:02 +0300 (IDT)

> Eeek that's some ugly code :)

No it isn't. Its compact but definetely not ugly. Small is beutiful.

Regards,

	Shlomi Fish

> Subject: Re: Perl Golf

----------------------------------------------------------------------
Shlomi Fish        [email-masked]
Home Page:         http://t2.technion.ac.il/~shlomif/

There's no point in keeping an idea to yourself since there's a 10 to 1
chance that somebody already has it and will share it before you.