Re: repetitive string in attrributes - advice/tactics requested

Josh Narins <[email protected]>
Newsgroups gmane.comp.lang.perl.modules.petal
Message-ID <[email protected]>
> i'm generating [a href=""]  on the fly a lot
> 
> the problem i'm having is that the bulk of the href is the same: ie
>     index.cgi?a=1&b=2&c=3&...z=1
>     index.cgi?a=1&b=2&c=3&...z=2
>     index.cgi?a=1&b=2&c=3&...z=3
> 
> my understanding of tal requires me to create the full href each time
> 
> is there any sort of magic where i would be able to not need to  
> specity the entire string?
> maybe something like:
>   baselink = index.cgi?a=1&b=2&c=3&..
>   href=baselink + attribute specific var

One is to generate the base string in the perl code that instantiates
and prints the petal template.


$template->process({ 
 base_href=> ('?' . join '&', map { $_ . '=' . $cgi{$_} } keys %cgi),
});


[a petal:attributes="href string:${base_href}&${unique_args}"]link[/a]
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.