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
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:
Sent: Friday, January 13, 2006 12:58 AM
Subject: -M in modperl
> opendir( DIR, "/path" );
> my @dots = grep(/recovery/,so
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 "$!
is the path you are using really absolute else see my mail from before
mp2 does not change to your document-root.
Tom
LUKE wrote:
> 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" <[EMAI
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:
Sent: Friday, January 13, 2006 1:06 AM
Subject: Re: -M in modperl
> The result is not sort by file's mtime!
> But if i run t
there is no such thing as apache 2.55
>>> "LUKE" <[EMAIL PROTECTED]> 12-Jan-06 12:17 >>>
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:
Sent: Friday, January 13, 2006 1:0
sorry apache2.0.55
- Original Message -
From: "LUKE" <[EMAIL PROTECTED]>
To:
Sent: Friday, January 13, 2006 1:17 AM
Subject: Re: -M in modperl
> 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 ---
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
Is it a fullpath problem?
my $path = "/path";
opendir( DIR, $path );
my @dots = grep(/recovery/, sort { -M "$path/$a" <=> -M "$path/$b" }
readdir(DIR));
closedir(DIR);
Note that the perlfunc documentation for readdir says:
If you're planning to filetest the return values out of a readdir,
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 References
Hi
The problem may lie in the kernal itself. I had a similar problem and
found that the kernal was to blame. Here is the code I can use in place of
the READDIR. Mike
my $name;
$file = $file . '/';
if ( -d $file ) {
if ( $readdir_hack eq "yes" ) {
$directory = $file;
> "Mike" == Mike OK <[EMAIL PROTECTED]> writes:
Mike> The problem may lie in the kernal itself. I had a similar problem
Mike> and found that the kernal was to blame.
This is a broad statement, and generates FUD. Can you be more specific? Can
you say where you thought the Kernel was to
Hello,
This should be very easy but apache is not letting me
do this. I have a list of file names stored in an
array. The list is created as follows:
push @resizeList, $img->{path} . $img->{file};
The list is passed to a package via a new method as
follows:
my $imageResize = Ishare::Clas
try @{$self->{resize_list}} ?
Harry Zhu
GreatLodge.com
- Original Message -
From: "Michael Greenish" <[EMAIL PROTECTED]>
To:
Sent: Thursday, January 12, 2006 1:09 PM
Subject: modperl not recognizing array reference
Hello,
This should be very easy but apache is not letting me
do th
> This should be very easy but apache is not letting me
> do this. I have a list of file names stored in an
> array. The list is created as follows:
>
> push @resizeList, $img->{path} . $img->{file};
>
>
> The list is passed to a package via a new method as
> follows:
>
> my $imageResize
OK, I can see that. I really don't have much more information to add. I
pulled my hair out for days trying to get the opendir readdir combination to
work. While searching, I came across another post that pointed at the
specific kernal I am using. I believe it was the way perl behaved with it.
T
On Thu, Jan 12, 2006 at 11:09:32AM -0800, Michael Greenish wrote:
> sub resizeImgs {
> my $self = shift;
> foreach my $file( @$self->{resize_list} ) {
> ...
>
> I get the following error:
>
> Not an ARRAY reference at
> /http/greanie/perl-lib/Ishare/Classes/ImageClass.pm
> line 193.
@$s
Since I am passing a reference to an anonymous hash
when calling the new method, the @_ only contains one
element, that reference. The '$objRef = shift;' in
the constructor brings the hash ref into the function.
When I print out the $self in my resize function, I
see the list, so it definitely ex
Well, that was definitely it. I did try wrapping in
{} but I guess I got a cached output because I still
got the error. This time, I restarted apache and
didn't get the error. Thanks for getting me
unstuck!!!
greanie
--- Ronald J Kimball <[EMAIL PROTECTED]>
wrote:
> On Thu, Jan 12, 2006 at 11
> -Original Message-
> From: Michael Greenish [mailto:[EMAIL PROTECTED]
> Sent: Thursday, January 12, 2006 1:46 PM
> To: modperl@perl.apache.org
> Subject: RE: modperl not recognizing array reference
>
> Since I am passing a reference to an anonymous hash
> when calling the new method, the
Hey gang,
We got mod_perl into the Apache Software Foundation press release that
just went out. You can read it here:
http://www.prnewswire.com/cgi-bin/stories.pl?
ACCT=104&STORY=/www/story/01-12-2006/0004248145&EDATE=
Thanks to everyone who has helped the project grow to this stage.
- Perrin
Hi Folks
>You can use FindBin and set it relative to your script's directory.
Is FindBin::Real a better choice?
--
Cheers
Ron Savage, [EMAIL PROTECTED] on 13/01/2006
http://savage.net.au/index.html
Let the record show: Microsoft is not an Australian company
-- Ron Savage <[EMAIL PROTECTED]>
Hi Folks
You can use FindBin and set it relative to your script's directory.
Is FindBin::Real a better choice?
FindBin::libs will locate the lib dir's based on your
path (using FindBin).
--
Steven Lembark 85-09 90th
24 matches
Mail list logo