Re: [htmltmpl] Patch to fix global_vars and loop problem...

2004-05-17 Thread simran
Hi Sam, Did you decide on what to do with the submitted patch? simran. On Wed, 2004-05-12 at 16:51, simran wrote: > very good points :-) > > How is the attached as a patch... > > simran. > > > > > On Wed, 2004-05-12 at 14:09, Sam Tregar wrote: > > On Wed, 12 May 2004, simran wrote: >

Re: [htmltmpl] Patch to fix global_vars and loop problem...

2004-05-13 Thread Mathew Robertson
good example -> given this , I would agreee that it is a bug. ... and yes you are correct, the stderr message is generated by 'use warnings' not 'use strict'. Mathew > > Relating this to TMPL_LOOP's... the question becomes, "Is a variable inside > > a loop considered to be equivalent to a hash

Re: [htmltmpl] Patch to fix global_vars and loop problem...

2004-05-13 Thread petersm
Mathew Robertson wrote: > Relating this to TMPL_LOOP's... the question becomes, "Is a variable inside > a loop considered to be equivalent to a hash key, or equivalent to a > variable?", alternatively it could be asked "What is the 'strict'ness of > TMPL_LOOP variables (as compared to Perl's u

Re: [htmltmpl] Patch to fix global_vars and loop problem...

2004-05-12 Thread simran
[...snip...] > > Another example: > > > > -- test.pl -- > > #!/usr/bin/perl > > my $tvar = "this is a test"; > > $tvar = undef; > > print "Tvar=$tvar\n"; > > - > > The above prints: Tvar= > > true - but only if you dont do: > > use strict; > use warnings;

Re: [htmltmpl] Patch to fix global_vars and loop problem...

2004-05-12 Thread Mathew Robertson
> > here you create a global variable called 'gvar' > > > $t->param(gvar => "global variable"); > > > > here you are creating a loop specific variable called 'gvar' > > > { loopvar => "GVar should be set", gvar => "Loop GVar 1" }, > > > > These two 'gvar's are two different variab

Re: [htmltmpl] Patch to fix global_vars and loop problem...

2004-05-12 Thread simran
> hmm... I dont consider this to be a bug... > > here you create a global variable called 'gvar' > > $t->param(gvar => "global variable"); > > here you are creating a loop specific variable called 'gvar' > > { loopvar => "GVar should be set", gvar => "Loop GVar 1" }, > > These t

Re: [htmltmpl] Patch to fix global_vars and loop problem...

2004-05-12 Thread Mathew Robertson
hmm... I dont consider this to be a bug... here you create a global variable called 'gvar' > $t->param(gvar => "global variable"); here you are creating a loop specific variable called 'gvar' > { loopvar => "GVar should be set", gvar => "Loop GVar 1" }, These two 'gvar's are two

Re: [htmltmpl] Patch to fix global_vars and loop problem...

2004-05-11 Thread simran
very good points :-) How is the attached as a patch... simran. On Wed, 2004-05-12 at 14:09, Sam Tregar wrote: > On Wed, 12 May 2004, simran wrote: > > > +foreach my $row (@$value) { > > + foreach my $key (keys %$row) { > > +$row->{$key} ||= ""; > > + }

Re: [htmltmpl] Patch to fix global_vars and loop problem...

2004-05-11 Thread Sam Tregar
On Wed, 12 May 2004, simran wrote: > +foreach my $row (@$value) { > + foreach my $key (keys %$row) { > +$row->{$key} ||= ""; > + } > +} H. What happens when $row->{$key} is "0"? What happens when undef is set in a loop within a loop? I think th

[htmltmpl] Patch to fix global_vars and loop problem...

2004-05-11 Thread simran
Hi Sam, et al, Here are the details of (what i consider to be a bug anyway) a bug in HTML::Template - its been bought up before, and you have mentioned that it does need fixing, but it annoyed me enough today to produce a patch for it and submit the patch :-) Take the following example: =