opendir( DIR, /path );
my @dots = grep(/recovery/,sort { -M $a = -M $b } readdir(DIR));
closedir(DIR);
Can not work in mod_perl?? How to solve it??
On Fri, 13 Jan 2006 00:58:39 +0800
LUKE [EMAIL PROTECTED] wrote:
opendir( DIR, /path );
my @dots = grep(/recovery/,sort { -M $a = -M $b } readdir(DIR));
closedir(DIR);
Can not work in mod_perl?? How to solve it??
What error do you receive? Most likely the reason it is not working
is
The result is not sort by file's mtime!
But if i run the code in cgi or shell. It is sort by file's mtime.
- Original Message -
From: LUKE [EMAIL PROTECTED]
To: modperl@perl.apache.org
Sent: Friday, January 13, 2006 12:58 AM
Subject: -M in modperl
opendir( DIR, /path );
my @dots
Hi,
There's not much information you are providing to us.
What version of mp are you using?
What's the error message you see, if there is any?
What are you trying to achieve?
And some debugging into your code like this:
--8--
opendir( DIR, /path )
or print STDERR $!
PROTECTED]
To: modperl@perl.apache.org
Sent: Friday, January 13, 2006 12:58 AM
Subject: -M in modperl
opendir( DIR, /path );
my @dots = grep(/recovery/,sort { -M $a = -M $b } readdir(DIR));
closedir(DIR);
Can not work in mod_perl?? How to solve it??
signature.asc
Description: OpenPGP
linux apache 2.55 mod_perl v2.02
The file will list,but it is not sort by file's mtime in mod_perl!
- Original Message -
From: LUKE [EMAIL PROTECTED]
To: modperl@perl.apache.org
Sent: Friday, January 13, 2006 1:06 AM
Subject: Re: -M in modperl
The result is not sort by file's
, 2006 1:06 AM
Subject: Re: -M in modperl
The result is not sort by file's mtime!
But if i run the code in cgi or shell. It is sort by file's mtime.
- Original Message -
From: LUKE [EMAIL PROTECTED]
To: modperl@perl.apache.org
Sent: Friday, January 13, 2006 12:58 AM
Subject: -M
Luke, the values you are sorting are the just filenames, so you must
prefix the full path, like this:
my $path='/path/'; # important to use trailing slash
opendir( DIR, $path );
my @dots = grep(/recovery/,sort { -M $path.$a = -M $path.$b } readdir(DIR));
closedir(DIR);
When you ran it before,
Hi Luke,
When posting a new message to the list, please start a new thread
instead of replying to an existing one and erasing everything. Mail
clients put References: headers in which allow Web archives and smart
mail clients to keep track related messages together. In your case,
your
/\.stat//;
}
}
}
- Original Message -
From: LUKE [EMAIL PROTECTED]
To: modperl@perl.apache.org
Sent: January 12, 2006 11:58 AM
Subject: -M in modperl
opendir( DIR, /path );
my @dots = grep(/recovery/,sort { -M $a = -M $b } readdir(DIR));
closedir(DIR);
Can not work
- Original Message -
From: Randal L. Schwartz merlyn@stonehenge.com
To: Mike OK [EMAIL PROTECTED]
Cc: LUKE [EMAIL PROTECTED]; modperl@perl.apache.org
Sent: January 12, 2006 1:53 PM
Subject: Re: -M in modperl
Mike == Mike OK [EMAIL PROTECTED] writes:
Mike The problem may lie in the kernal
11 matches
Mail list logo