in reply to compare always true in grep

I get a syntax error (albeit on a different version):
perl ptest.pl Not enough arguments for grep at ptest.pl line 9, near "99999999)" Execution of ptest.pl aborted due to compilation errors. perl -v This is perl 5, version 12, subversion 2 (v5.12.2) built for x86_64-li +nux

Tip #6 from the Basic debugging checklist: B::Deparse

perl -MO=Deparse ptest.pl Not enough arguments for grep at ptest.pl line 9, near "99999999)" ptest.pl had compilation errors. use warnings; use strict 'refs'; my(@times) = (1, 2, 3, 4); print STDERR "Times: @times\n"; if (grep, @times) { die 'Time values must be < 99999999'; }

Replies are listed 'Best First'.
Re^2: compare always true in grep
by RonW (Parson) on Oct 24, 2014 at 19:06 UTC

    the deparse on Windows is:

    if (grep((0 + $_ >= 99999999)), @times)

    Which looks like the expression parser is stricter than the one in the Perl on the Linux PC.

    In a factory right now, and the Linux PCs are currently busy running robots, so I can't check until the next change over, sometime tomorrow. (Also can't access my office PCs until I get back to the office)