in reply to Re^2: Perl generating embedded Perl
in thread Perl generating embedded Perl

Perl code + Template = Text::Template
use warnings; use strict; use Text::Template qw(fill_in_string); print fill_in_string(<<'EOT'); Numbers generated at { $start_time = time }<br>{ for my $x (1 .. 4) { $OUT .= "\nNumber=$x<br>" } } Time used { time - $start_time } seconds.<br> EOT

Replies are listed 'Best First'.
Re^4: Perl generating embedded Perl
by AriSoft (Sexton) on Feb 07, 2010 at 07:37 UTC

    You are right. When I started this experiment I already knew that this will be just an another template script. Actually there were so many on them that I decided to go faster if I make my own instead of evaluating every one of already made template srcipts. I can also learn something valuable as I really did.

    I used the same approach with my first Perl program too. That was a multithreaded HTTP server. When I have tried some already available versions, which finally did not install in Windows or was too complicated to understand at my level of knowlegde. I made my own. It took days to debug because there is a bug in Windows socket code in Strawberry Perl release. (Reported: https://rt.cpan.org/Public/Bug/Display.html?id=54285)

      Um, that bug is not specific to strawberry, just win32