Subject: Perl Humour

From: Shlomi Fish <[email-masked]>
Date: Mon, 6 Nov 2000 16:32:33 +0200 (IST)

Check the following URL:

http://209.152.214.112/IAQ/IAQlist.html

It's very funny.

Regards,

	Shlomi Fish

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

The prefix "God Said" has the extraordinary logical property of 
converting any statement that follows it into a true one.

---

From: Moshe Zadka <[email-masked]>
Date: Mon, 6 Nov 2000 16:42:40 +0200 (IST)

> http://209.152.214.112/IAQ/IAQlist.html

Weak. Very weak.
--
Moshe Zadka <[email-masked]> -- 95855124
http://advogato.org/person/moshez

---

From: Gaal Yahas <[email-masked]>
Date: Mon, 6 Nov 2000 21:45:43 +0200

> http://209.152.214.112/IAQ/IAQlist.html

Regarding this:

                         How do I get tomorrow's date?

   Use this function:
        sub tomorrow_date {
          sleep 86_400;
          return localtime();
        }

It has been pointed out (not by me) that this is very inefficient.
It is probably better to do this instead:

        sub tomorrow_date_efficient {
          sleep 86_400;
          return localtime();
          sleep -86_400;
        }

-- 
Gaal Yahas <[email-masked]>

---

From: Omer Zak <[email-masked]>
Date: Mon, 6 Nov 2000 22:06:00 +0200 (IST)

The original solution is inefficient but safe.

The alternative solution (which uses negative sleep times) is very
dangerous, because if the absolute value of the (negative) sleep time is
even 1uS too long, you may cause GCF*, with very unpredictable
but grave consequences to the world, as we know it.

I strongly recommend the boring but efficient solution of adding 1
(Babylonian time composite modulo) to the result of localtime().

          With *very* **very** ***very*** serious face,
                                                     --- Omer
WARNING TO SPAMMERS:  see at http://www.zak.co.il/spamwarning.html
* GCF = General Casuality Fault

---

From: Gaal Yahas <[email-masked]>
Date: Mon, 6 Nov 2000 22:14:52 +0200

While in general your warning ought to be heeded, this is in fact
a special case where the code *is* safe, because the negative
sleep takes place after the function returns.

This code is indeed unsafe:

         sub tomorrow_date_not_quite_efficient_and_unsafe {
           sleep 86_400;
           my @tmp = localtime();
           my $tmp = scalar localtime;
           sleep -86_400;
           return wantarray ? @tmp : $tmp;
         }

but I wouldn't recommend it to anyone for exactly this reason.
It also needs temporary variables, which the original suggestions
don't.

On Mon, Nov 06, 2000 at 10:06:00PM +0200, Omer Zak wrote:
> To unsubscribe from this group, send an email to:
> [email-masked]
> 
> 
>