in reply to Sorting (GRT) and locale issues

I was going to ask if looks like there's something wrong with my locale: it should be Australia (ideally), prob defaults to US, but in either case

substr( $_, 1 ), substr( $_, 0, 1 ), $_ } on A437 should give
437 A A437
ie the nums are at the front regardless. The top code just shows that lower/uppercase is mixed or upper then lower, but nums are always first...

Sorry if it seems I'm being obtuse; I REALLY want to understand this.

Chris

Replies are listed 'Best First'.
Re^2: Sorting (GRT) and locale issues
by ikegami (Patriarch) on Nov 15, 2007 at 06:28 UTC
    You don't pass '437 A A437', you pass the result of pack('N A1 A*', '437', 'A', 'A437').
    use Data::Dumper qw( Dumper ); for (qw[ A066 A067 A098 A099 ]) { my $coded = pack('N A1 A*', substr($_, 1), substr($_, 0, 1), $_); local $Data::Dumper::Useqq = 1; local $Data::Dumper::Terse = 1; print("$_: ", Dumper($coded)); }
    A066: "\0\0\0BAA066" A067: "\0\0\0CAA067" A098: "\0\0\0bAA098" A099: "\0\0\0cAA099"

    PS - Why do you keep replying to your node?