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

perl bug with leading \n and gt

Thread Next
Eric Spencer
September 28, 2001 06:58
perl bug with leading \n and gt
Message ID:
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 Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About