Thanks Monks for reply and it's working. Now i change the file a little more and got message "Error:EVAL_PERL not set". Could you tell me how to set EVAL_PERL in template . Another issue is that when i run program B it's showing the value of random but in Program A it it not showing the Value of random A.

Program A

[% TRY %] [% PERL %] use WebService::CaptchasDotNet; my $o = WebService::CaptchasDotNet->new(secret => 'secret', username => 'demo'); my $random = $o->random; print "random=", $random; my $url = $o->url($random); print $url; [% END %] [% CATCH %] Error:[% error.info %] [% END %] <html> <title> This is Example of using perl with HTML </title> </html>

Program B

#!/usr/bin/perl use strict; use warnings; use WebService::CaptchasDotNet; my $o = WebService::CaptchasDotNet->new(secret => 'secret', username = +> 'demo'); my $random = $o->random(); print "Random value = ". $random; my $url = $o->url($random);

In reply to Re^2: How to use Prel in HTML Template?? by Sachin
in thread How to use Perl in HTML Template? by Sachin

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.