writing html content in a perl script to a file in a specific directory -


i have following code in perl/cgi script:

$commoncontent = <<html;  <font color="#cc0000"><strong>$errstr</strong></font>  <h2 class="first">request id: $recid<br />(requested by: $userinfo->[1], $userinfo->[3], $userinfo->[5])</h2>  <h3 style="margin-bottom:16px">website: $website</h3>  <p><strong>request type: $request</strong></p>  <p>request description:<br />$description</p>  <p>priority/required turnaround time: $priority</p>  <p>pre-deployment review: $review</p>  <p><strong><i>estimated completion date request: $completiondate</i></strong></p> html 

i want write contents of html file in directory can keep record. know how this? have read perl cookbook second edition , pro perl on issue perlish me.

look @ perl's open().

you want open filehandle, , print variable filehandle.

open(my $fh, '>', "output.html") or die $!; 

Comments

Popular posts from this blog

Add email recipient to all new Trac tickets -

400 Bad Request on Apache/PHP AddHandler wrapper -

php - Change action and image src url's with jQuery -