Re: somevar = BLOCK and passing switches
Bill Ward <[email protected]> Wed, 8 May 2013 17:25:39 -0700
| Newsgroups | gmane.comp.lang.perl.modules.template-toolkit |
|---|---|
| Message-ID | <CAKGT8Wpnk7Bjo1aa+0_NP=SYy1Nwh1CejQDuMoMMMPd3OYShDA@mail.gmail.com> |
I don't think it's making an anonymous block ... I think it's evaluating the block and assigning a string to some_name, which you can then print. It's not like some_name is a subroutine. On Wed, May 8, 2013 at 5:05 PM, Summer <crazysummer2004-/[email protected]> wrote: > well, it won't work that way because I am using it as an anonymous block.. > ie. > > [% > some_name = BLOCK; > # ton of data > END; > %] > > If I try to call it like so: PROCESS some_name, I get a stack trace which > complains about that block not existing. > > The way you propose would be the standard block declaration: > > BLOCK some_name; > > END; > > That will work, but the problem is I don't want to process all that info > again. I want to process it once then display that output 'n' number of > times... except one of those times, I want some data omitted. > > thanks > > ------------------------------ > *From:* Larry Leszczynski <[email protected]> > *To:* [email protected] > *Sent:* Wednesday, May 8, 2013 4:49 PM > *Subject:* Re: [Templates] somevar = BLOCK and passing switches > > Hi Summer - > > > [% some_name; token_to_omit =1 %] > > > > some_name does not respect that variable "token_to_omit" > > Did you try: > > [% PROCESS some_name token_to_omit=1 %] > > (No semicolon after "some_name".) > > http://www.template-toolkit.org/docs/manual/Directives.html#section_BLOCK > > > HTH, > Larry > > _______________________________________________ > templates mailing list > [email protected] > http://mail.template-toolkit.org/mailman/listinfo/templates > > > > _______________________________________________ > templates mailing list > [email protected] > http://mail.template-toolkit.org/mailman/listinfo/templates > > -- Check out my LEGO blog at brickpile.com <http://www.brickpile.com/> Follow/friend me: Facebook <http://facebook.com/billward> • Flickr<http://flickr.com/photos/billward/>• Twitter <http://twitter.com/williamward> • LinkedIn<http://www.linkedin.com/pub/william-ward/63/393/985/> _______________________________________________ templates mailing list [email protected] http://mail.template-toolkit.org/mailman/listinfo/templates