[Israel.pm] Fail to compile

Offer Kaye offer.kaye at gmail.com
Thu Nov 1 07:55:03 PDT 2007

On 10/25/07, Shmuel Fomberg wrote:
> But it still interesting. Why did Perl fail on his machine on compile time
> and on my machine in run time? Any idea?

This is a compile-time error on both my Windows and Linux machines.
Which is a bit odd because the documentation says it is a run-time error...

You can make it into a run-time error by changing the code to:
my $zero = 0;
my $err = 5/$zero;

I can guess that the 5/0 is simple enough to be caught in the
compilation stage, while using a variable forces it to way for the
runtime stage.

Offer Kaye

More information about the Perl mailing list