- or download this
# When sorting lists of files, I want the index file to always come fi
+rst.
if ($c =~ /^index\./) {
...
elsif ($d =~ /^index\./) {
return 1;
}
- or download this
$ perl PM1021473_3_unstable.pl
index.0001 afile article -1
index.0001 index.0005 article -1
index.9999 index.0005 article -1
- or download this
#!/usr/bin/perl
#
...
index.0001 afile article
index.0001 index.0005 article
index.9999 index.0005 article
- or download this
sub my_sort_article {
my ($c,$d,$type) = @_;
...
}
return $c cmp $d;
}
- or download this
sub split_out_leading_number {
my $s = shift;
...
die "split_out_leading_number received bogus input '$s'!\n";
}
- or download this
sub my_sort_article {
my ($c,$d,$type) = @_;
...
$c cmp $d;
}
}
- or download this
my @list = ( qw( apple Alpha aLBAtross aLbAcOre etc... ) );
my @result = sort {uc($a) cmp uc($b)} @original;
- or download this
my @list = (
[qw( APPLE apple )],
...
[qw( ALBACORE aLbAcOrE)],
etc...
);
- or download this
my @result = sort { $a->[0] cmp $b->[0] } @list;
- or download this
my @list = (
[qw( ALBACORE aLbAcOrE)],
...
[qw( APPLE apple )],
etc...
);
- or download this
my @list = ( qw( apple Alpha aLBAtross aLbAcOre etc... ) );
...
# Now convert the resulting list back into (aLbAcOrE aLBAtross...) for
+mat:
@result = map { $_->[1] } @result;
- or download this
my @list = ( qw( apple Alpha aLBAtross aLbAcOre etc... ) );
my @result = map {$_->[1] } # .sgnirts desacreppu eht
+ lla tou pirts #
sort {$a->[0] cmp $b->[0]} # neht dna ,sgnirts desacrep
+pu eht no tros #
map { [ uc($_), $_ ] } # ,gnirts eht fo noisrev desa
+creppu eht dda #
@list; #
+ ,tsil a neviG #