in reply to Determing "numeric value" of string?

You've just rediscovered the Schwartzian Transform.

Update: Misunderstood where the OP was troubled - disregard.

  • Comment on Re: Determing "numeric value" of string?

Replies are listed 'Best First'.
Re^2: Determing "numeric value" of string?
by Anonymous Monk on Feb 11, 2009 at 19:45 UTC
    oh boy...I was hoping it might be a little easier as most things are with Perl :)

    Here is some test code :

    use warnings; use strict; comparison( "This is another String", "This is yet another string"); comparison( "T5", "T4"); comparison( "1 begins this string", "2"); sub comparison { my($a,$b) = @_; print "ORD: " . ord($a) . "\n"; print "ORD: " . ord($b) . "\n"; if ( $a le $b ) { print " string :$a: is less than string :$b:\n\n"; } else { print " string :$a: is greater than string :$b:\n\n"; } }
    Still, my problem is I can't get the numerical value of the strings I'm comparing...