develooper Front page | perl.perl5.porters | Postings from September 2001

perl bug with leading \n and gt

Thread Next
From:
Eric Spencer
Date:
September 28, 2001 06:58
Subject:
perl bug with leading \n and gt
Message ID:
ADEKKKECEMDCLKJCOBANKEPHCBAA.espencer@ibex-systems.com
If this is the wrong list for this sort of thing, please advise.

Consider the following code:

$L = "\n".' test';
$L2 = ' test';
if($L gt ' '){ print 'greater than space'; } else { print 'not greater'; }

when compared against $L the following code prints 'not greater'. When
compared against $L2 ($L without the leading \n), it works as expected.
According to the perlopt man page gt does a binary comparison which should
work in these cases. Obviously, either string is gt a space. Am I missing
something here?



Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About