You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl@perl.apache.org by Joachim Zobel <jz...@heute-morgen.de> on 2004/05/13 20:43:43 UTC

How do I set mtime

Hi.

I try to use the $r->mtime($upd) method to set a pages last modified to
a database timestamp. perldoc Apache::File tells me
 
 "The last modified time may also be changed using this method"

My error log however says "Usage: Apache::mtime(r)", if I try.

So how do I do it? I do not want to use update_mtime. Normally mtime is
set by SSI XBitHack full and pretty OK. I want to set it only in special
cases. 

Thx,
Joachim

-- 
"... ein Geschlecht erfinderischer Zwerge, die fuer alles gemietet werden 
koennen."                            - Bertolt Brecht - Leben des Galilei 


-- 
Report problems: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html
List etiquette: http://perl.apache.org/maillist/email-etiquette.html


Re: How do I set mtime

Posted by Stas Bekman <st...@stason.org>.
Geoffrey Young wrote:
>>$r->mtime() is read only.  to update the mtime slot you want to use
>>$r->update_mtime(), update_mtime which is smart enough to only replace the
>>mtime if the time you're updating with is later than the current mtime.
>>you'll also want to make sure that you're doing this before you call
>>$r->send_http_header.
> 
> 
> whoops, I see stas has said as much in his reply that I missed.  sorry.

No worries. I've updated the docs.

-- 
__________________________________________________________________
Stas Bekman            JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/     mod_perl Guide ---> http://perl.apache.org
mailto:stas@stason.org http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com

-- 
Report problems: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html
List etiquette: http://perl.apache.org/maillist/email-etiquette.html


Re: How do I set mtime

Posted by Geoffrey Young <ge...@modperlcookbook.org>.
> $r->mtime() is read only.  to update the mtime slot you want to use
> $r->update_mtime(), update_mtime which is smart enough to only replace the
> mtime if the time you're updating with is later than the current mtime.
> you'll also want to make sure that you're doing this before you call
> $r->send_http_header.

whoops, I see stas has said as much in his reply that I missed.  sorry.

--Geoff

-- 
Report problems: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html
List etiquette: http://perl.apache.org/maillist/email-etiquette.html


Re: How do I set mtime

Posted by Geoffrey Young <ge...@modperlcookbook.org>.

Joachim Zobel wrote:
> Hi.
> 
> I try to use the $r->mtime($upd) method to set a pages last modified to
> a database timestamp. perldoc Apache::File tells me
>  
>  "The last modified time may also be changed using this method"
> 
> My error log however says "Usage: Apache::mtime(r)", if I try.
> 
> So how do I do it? I do not want to use update_mtime. Normally mtime is
> set by SSI XBitHack full and pretty OK. I want to set it only in special
> cases. 

$r->mtime() is read only.  to update the mtime slot you want to use
$r->update_mtime(), update_mtime which is smart enough to only replace the
mtime if the time you're updating with is later than the current mtime.
you'll also want to make sure that you're doing this before you call
$r->send_http_header.

HTH

--Geoff

-- 
Report problems: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html
List etiquette: http://perl.apache.org/maillist/email-etiquette.html


Re: How do I set mtime

Posted by Stas Bekman <st...@stason.org>.
Joachim Zobel wrote:
> Hi.
> 
> I try to use the $r->mtime($upd) method to set a pages last modified to
> a database timestamp. perldoc Apache::File tells me
>  
>  "The last modified time may also be changed using this method"
> 
> My error log however says "Usage: Apache::mtime(r)", if I try.
> 
> So how do I do it? I do not want to use update_mtime. Normally mtime is
> set by SSI XBitHack full and pretty OK. I want to set it only in special
> cases. 

Probably the doc is not matching the reality. Try update_mtime documented at:
http://perl.apache.org/docs/1.0/api/Apache/File.html#Apache_Methods_added_by_Apache__File

-- 
__________________________________________________________________
Stas Bekman            JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/     mod_perl Guide ---> http://perl.apache.org
mailto:stas@stason.org http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com

-- 
Report problems: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html
List etiquette: http://perl.apache.org/maillist/email-etiquette.html