Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

global vars and text tag::template help.

Status
Not open for further replies.

cykill

Technical User
Feb 9, 2005
16
0
0
US
i want to know does the variable $emailaddress exist in $template1? or can I use $emailaddress in <#MY_TAG>?
sorry, i have trouble explaining this.


my $template1 = "/templates/v_template.html";
my $template2 = "/templates/c_template.html";
foreach $emailaddress(@email)
{
open (MAIL, $mailcmd)|| die "sendmail: $!";
print MAIL <<EOF;
From: support\@email.com
TO: $emailaddress
CC: support\@email.com
Subject: text
Content-type: text/html
EOF
print MAIL $PARSER->parse_file($template1);
print MAIL $PARSER->parse_file($template2);
close MAIL;
}
_______________________
in v_template.html

<html>
<#MY TAG>
</html>

_______________________
in my tag module

add_tag( MY_TAG =>sub{

print $emailaddress;
});
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top