-M in modperl

2006-01-12 Thread LUKE
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??

Re: -M in modperl

2006-01-12 Thread Frank Wiles
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

Re: -M in modperl

2006-01-12 Thread LUKE
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

Re: -M in modperl

2006-01-12 Thread Tom Schindl
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 "$!

Re: -M in modperl

2006-01-12 Thread Tom Schindl
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

Re: -M in modperl

2006-01-12 Thread LUKE
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

Re: -M in modperl

2006-01-12 Thread Mark Galbreath
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

Re: -M in modperl

2006-01-12 Thread LUKE
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 ---

Re: -M in modperl

2006-01-12 Thread John ORourke
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

Re: -M in modperl

2006-01-12 Thread Jeff
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,

Re: -M in modperl

2006-01-12 Thread Scott Gifford
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

Re: -M in modperl

2006-01-12 Thread Mike OK
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;

Re: -M in modperl

2006-01-12 Thread Randal L. Schwartz
> "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

modperl not recognizing array reference

2006-01-12 Thread Michael Greenish
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

Re: modperl not recognizing array reference

2006-01-12 Thread Harry Zhu
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

RE: modperl not recognizing array reference

2006-01-12 Thread Carmichael, Lee
> 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

Re: -M in modperl

2006-01-12 Thread Mike OK
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

Re: modperl not recognizing array reference

2006-01-12 Thread Ronald J Kimball
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

RE: modperl not recognizing array reference

2006-01-12 Thread Michael Greenish
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

Re: modperl not recognizing array reference

2006-01-12 Thread Michael Greenish
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

RE: modperl not recognizing array reference

2006-01-12 Thread Carmichael, Lee
> -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

press release

2006-01-12 Thread Perrin Harkins
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

Re: making versioned libraries work on the same server

2006-01-12 Thread Ron Savage
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

Re: making versioned libraries work on the same server

2006-01-12 Thread Steven Lembark
-- 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