parsing template

2009-12-16 Thread Avani
Hi all,

I am very new to perl. I have to parse template in perl.

do anybody have any reference code to do it?

currently I am using regular expression. Right now, i m only able to
replace variables. HOw to do it for for loop and if conditions ?

pls help me.

thanks in advance.


-- 
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/




Re: parsing template

2009-12-16 Thread Shlomi Fish
On Wednesday 16 Dec 2009 10:10:24 Avani wrote:
 Hi all,
 
 I am very new to perl. I have to parse template in perl.
 
 do anybody have any reference code to do it?
 
 currently I am using regular expression. Right now, i m only able to
 replace variables. HOw to do it for for loop and if conditions ?
 
 pls help me.


There are already several high-quality templating systems for Perl - please 
don't create your own custom one:

* http://search.cpan.org/dist/Text-Template/ - basically just embedded Perl.

* http://search.cpan.org/dist/HTML-Template/ - more powerful than T-T but 
quite quirky.

* http://template-toolkit.org/ - very powerful and my personal favourite.

There are many others, but these are the most popular ones. Please use one of 
those. Also see:

http://www.shlomifish.org/humour/fortunes/sharp-perl.html#many-types-of-wheels

Regards,

Shlomi Fish

-- 
-
Shlomi Fish   http://www.shlomifish.org/
Best Introductory Programming Language - http://shlom.in/intro-lang

Bzr is slower than Subversion in combination with Sourceforge. 
( By: http://dazjorz.com/ )

-- 
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/




Re: parsing template

2009-12-16 Thread Philip Potter
2009/12/16 Avani avani.v.puj...@gmail.com:
 Hi all,

 I am very new to perl. I have to parse template in perl.

 do anybody have any reference code to do it?

 currently I am using regular expression. Right now, i m only able to
 replace variables. HOw to do it for for loop and if conditions ?

You may have to give more details, because I'm not entirely sure what
you want. What does parse template mean? What is your input? What is
your output? Can you give real examples of what you would like your
program to do?

If you have a file with a regular structure which you would like to
parse according to some kind of template, take a look at
Template::Extract in CPAN.

Phil

-- 
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/