Re: caller information

lojza vitasek <[email protected]> Thu, 16 Oct 2003 08:05:07 +0000
Newsgroups gmane.comp.web.wml
Message-ID <[email protected]>
Hello,

Axel Rose wrote:
> 
> Coming from a different system (BBEdit) I'd like to implement
> the following idea I used there:
> 
> ---
> This file was last modified
> #include "my-mod-info.pl"
> 
> #include "content.html"
> 
> The content was last modified
> #include "my-mod-info.pl" file="content.html"
> ---
> 
> "my-mod-info.pl" is a Perl script which produces file system
> information. Called with a file parameter it checks the
> included "content.html" otherwise it checks the caller.
> 
> How could I possibly find out who the caller is?
> Do I need a different mechanism here?

To produce `last modified' info texts you can use variables (pass 2
like WML_SRC_ISOTIME. There is also variable
WML_SRC_FILENAME, WML_SRC_DIRNAME and othes. See wml man page or

   http://www.thewml.org/docs/frontend/wml.html#environment

An example:

file template.wml:

# this is template.wml
<:

# get caller name
$caller = $WML_SRC_FILENAME;

# do something interesting with $caller
print $caller;

:>

{#BODY_LOC#}
<hr>
last modified time: <get-var WML_SRC_ISOTIME>

{#BODY_LOC#:


file page.wml:
#include "template.wml"
HELLO


Now

$ wml template.wml
template.wml
<hr>
last modified time: 2003-10-16 08:09:36

$ wml page.wml
page.wml
HELLO
<hr>
last modified time: 2003-10-16 08:09:15


Lojza Vitasek

_____________________________________________________________________
Website META Language (WML)                         http://thewml.org
User Support Mailing List                        [email protected]
Automated List Manager                            [email protected]