develooper Front page | perl.perl6.language | Postings from February 2004

Re: Exegesis 7: Dynamic Headers

Thread Previous
From:
Damian Conway
Date:
February 28, 2004 14:03
Subject:
Re: Exegesis 7: Dynamic Headers
Message ID:
40410FF0.1040702@conway.org
Gregor N. Purdy wrote:

> In "From the crown of his head to the sole of his foot..." (clearly
> a reference to a Gilligan's Island episode where Lovey said something
> similar :), we have:
> 
>   :header{ ..., odd => "Act, $act, Scene $scene    ...", ... }
> 
> and below, text indicating that it will
> 
>   "prepend the act and scene information to the start of any odd page
>   (except, of course, the first or the last), ..."
> 
> I don't see how that can be. The string will be evaluated and
> interpolated at the time the option pair is constructed, 

Yep.


> most likely with C<$act> and C<$scene> undef. 

The implication is they hold the current scene and act.


> After that, the same static text will appear in the header.

Correct. For the current scene and act.

I never said it would be dynamic.


> I suppose 
> 
>   ... odd => sub { "Act, $act, Scene $scene ..." }, ...
> 
> would work, though.

Yes indeed. Though you'd still need some way of dynamically setting those two 
variables as you format.

Damian

Thread Previous


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About