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

Eh… what is happening here?

/usr/local/apache $ perl -n -e "s/\s+#.*//; print if $_" conf/httpd.conf
Illegal division by zero at -e line 1, <> line 1.

FYI, this is 5.6.1.

Replies are listed 'Best First'.
Re: Division by 0 on regex?
by Aristotle (Chancellor) on Jan 10, 2002 at 03:52 UTC

    Argh, nevermind, stupid doublequotes bit me again :-)

    I fear not Perl, but bash still scares me. Sigh.

      I used to have no end of problems like this, but then got in the habbit of always using single-quotes in perl -e 'foo' constructs. (And using perl -le 'foo', too.)

      Thanks,
      James Mastros,
      Just Another Perl Scribe