Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Answer: lt versus le in string comparision

( #174203=categorized answer: print w/ replies, xml ) Need Help??

Q&A > strings > lt versus le in string comparision contributed by Abigail-II

Consider this:
my $str = 'y'; $str ++; print "$str\n"; $str ++; print "$str\n";
This will print
    z
    aa
Now, both z and aa are less or equal to z. It isn't until you reach za that you have a string that isn't less or equal to z.

Abigail

Comment on Answer: lt versus le in string comparision
Download Code
Log In?
Username:
Password:

What's my password?
Create A New User
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others pondering the Monastery: (12)
As of 2015-07-01 21:18 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (22 votes), past polls