From: Nicholas Clark Date: Tue, 21 Dec 2004 11:58:53 +0000 (+0000) Subject: Note that the shell's test uses eq etc for numbers, = etc for X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=8886331dd4b839d5227a0a7455922ad41c74f30f;p=p5sagit%2Fp5-mst-13.2.git Note that the shell's test uses eq etc for numbers, = etc for strings, the reverse of Perl, which is definitely a trap. Spotted by Alexei Alexandrov. p4raw-id: //depot/perl@23663 --- diff --git a/AUTHORS b/AUTHORS index dd52926..8daf646 100644 --- a/AUTHORS +++ b/AUTHORS @@ -31,6 +31,7 @@ Alan Ferrency Albert Chin-A-Young Albert Dvornik Alessandro Forghieri +Alexei Alexandrov Alex Gough Alex Vandiver Alexander Gough diff --git a/pod/perltrap.pod b/pod/perltrap.pod index d8f667c..0ad0086 100644 --- a/pod/perltrap.pod +++ b/pod/perltrap.pod @@ -267,6 +267,13 @@ The arguments are available via @ARGV, not $1, $2, etc. The environment is not automatically made available as separate scalar variables. +=item * + +The shell's C uses "=", "!=", "<" etc for string comparisons and "-eq", +"-ne", "-lt" etc for numeric comparisons. This is the reverse of Perl, which +uses C, C, C for string comparisons, and C<==>, C C<< < >> etc +for numeric comparisons. + =back =head2 Perl Traps