git://git.jankratochvil.net
/
nethome.git
/ blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
history
|
raw
|
HEAD
update
[nethome.git]
/
bin
/
sortn
1
#! /usr/bin/perl
2
# $Id$
3
4
use strict;
5
use warnings;
6
print sort {
7
my $a=$a;
8
my $b=$b;
9
while ($a ne "" || $b ne "") {
10
$a=~s/^(\D*)//s;
11
my $as=$1;
12
$b=~s/^(\D*)//s;
13
my $bs=$1;
14
my $rs=$as cmp $bs;
15
return $rs if $rs;
16
$a=~s/^(\d*)//s;
17
my $an=$1;
18
$b=~s/^(\d*)//s;
19
my $bn=$1;
20
my $rn=$an<=>$bn;
21
return $rn if $rn;
22
}
23
return 0;
24
} @ARGV ? map "$_\n",@ARGV : <>;