On Mar 31, 11:44 am, [EMAIL PROTECTED] (Dr.Ruud) wrote:
> [EMAIL PROTECTED] schreef:
>
> > unsorted:
> > 22
> > 2-2
> > 2-3
> > 23
> > 21
>
> > linux sort produces:
> > 21
> > 22
> > 2-2
> > 23
> > 2-3
>
> $ echo '
> 21
> 22
> 2-4
> 2-2
> 23
> 2-3
> ' |sort -n
>
> 2-2
> 2-3
> 2-4
> 21
> 22
> 23
>
> --
> Affijn, Ruud
>
> "Gewoon is een tijger."

That's exactly my point.

The standard sort doesn't act like the sort -n.
So when I do string compares in perl (gt, eq, lt)
they compare like the standard sort.

I want to do string compares like the sort -n.
I presume a byte comparision of each char in the string
will work (at the expense of speed).

Is there a way to do a string comparison in perl
so that the relationship is identical to the sort -n?

TIA


--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/


Reply via email to