in reply to compare always true in grep
The problem is that you used the following grep:
grep((0 + $_) >= 99999999)
You meant to use the following grep:
grep(((0 + $_) >= 99999999), @times)
Be careful when you omit parens around arguments.
You must have had different code on your linux system. Side-effects aside,
is the same thing asif (EXPR, @times) { ... }
on all platforms.if (@times) { ... }
Note that
was a syntax error before 5.18. In 5.18, it was changed to be equivalent togrep(EXPR)
grep(EXPR, @empty)
The mentions of a syntax error by the other posters is not relevant to the question; they're simply using an older version of Perl than the versions present on each of your systems.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: compare always true in grep
by RonW (Parson) on Oct 24, 2014 at 19:13 UTC |