renpai has asked for the wisdom of the Perl Monks concerning the following question:

I'm trying to put a unix command in the perl program.Bascially its for calculating the number of file excess in a particular day. example: cat <...path of the file> | grep (date) |grep (file name) |wc -l

Replies are listed 'Best First'.
Re: what is illegal division by zero
by mr_mischief (Monsignor) on May 31, 2001 at 09:34 UTC
    Illegal division by zero means just that - you can't have zero as the denominator of a fraction or the second operand of a division, because that would be undefined. Computers don't deal well with this, just like humans don't. You should check to see if a number is zero before trying to divide by it. Don't feel bad, though, abut having this type of error crop up. There's a potential divide-by-zero error in Benchmark.pm (as ships with 5.6.0 anyway -- see p5p or bugs.perl.org for discussion of that). Chris
Re: what is illegal division by zero
by mpolo (Chaplain) on May 31, 2001 at 16:29 UTC
    My suspicion is that the slashes in your filename are being misinterpreted as divisions(or possibly in your date). Make sure you're quoting correctly.