[Petal] [BUG] can't set variables to static values

Jean-Michel Hiver jhiver at mkdoc.com
Fri May 23 10:45:35 BST 2003


On Thu 22-May-2003 at 03:56:34PM +0100, Steve Purkis wrote:
> On Thursday, May 22, 2003, at 03:26  pm, Jean-Michel Hiver wrote:
> 
> >>	<span petal:if="false: lang">
> >>		<?var name="set: lang/fu string:1"?>
> >>	</span>
> >>
> >>	lang-fu: $lang/fu
> >>
> >>It lets me set lang/fu fine (ie: if I take out the last line, it
> >>works).  And I've tried variations on the theme to no avail.  Any 
> >>ideas?
> >
> >I see... Basically you're internally creating a 'lang/fu' hash key, but
> >then you can't access this value using $lang/fu because Petal is trying
> >to access $hash->{lang}->fu() or $hash->{lang}->{fu}...
> 
> Yup - auto-vivifying a hash was what I was hoping it would do...

You might want to take a look into Petal/Hash.pm and change the way the
'set:' modifier works... From there you can either write your own set:
modifier or submit a patch on the list :)

Cheers,
-- 
Building a better web - http://www.mkdoc.com/
---------------------------------------------
Jean-Michel Hiver
jhiver at mkdoc.com  - +44 (0)114 255 8097
Homepage: http://www.webmatrix.net/


More information about the Petal mailing list