LMPX.COM |
Home | Linux | Mysql | PHP | XML | ||
|
|
|||
From: John Delacour Date: Fri Jan 30 03:04:50 2004 Subject: Re: [MacPerl-AnyPerl] Sorting a file list
At 12:37 am +0100 30/1/04, Eelco Alosery wrote:
>how do i combine this together
Like this, but now it's time for _you_ to do some footwork :-)
my $db = "/tmp/tmp";
my ($date, $s1, $s2);
open DB, $db;
for (<DB>) {
s~^(..)-(..)-(....)(.+)~$3$2$1$4~;
push @temp, $_ ;
}
for (sort @temp) {
chomp;
s~(....)(..)(..)(.+)~$3-$2-$1$4~;
($date, $s1, $s2) = split /\|/ ;
$date and print "??? $date ??? $s1 ??? $s2 ??? $/" ;
}
| Navigate in group perl.macperl.anyperl at sever nntp.perl.org | |
| Previous | Next |
| © No Copyright You are free to use Anything |
Site Maintained by PHP Developer
Powered By PHP Consultants |