# WARNING: simplistic work flow for demo purposes # create Template object my $template = Template->new({ INCLUDE_PATH => '/search/path', # ... }); # define template variables for replacement my $vars_for_windows = { # whatever a windows path looks like SHEBANG => '#!\...\straw...\perl.exe', LOCATION_OF_VARIABLES_CGI_FILE => 'c:\abc\xyz\variables.cgi', }; my $vars_for_linux = { SHEBANG => '#!/usr/bin/perl', LOCATION_OF_VARIABLES_CGI_FILE => '/usr/xyy/abc/variables.cgi', }; # specify input filename, or file handle, text reference, etc. my $input = 'ABC.in'; if( $target_is_windows ){ # process input template, substituting variables, final output filename $template->process($input, $vars_for_windows, 'ABC.cgi') || die $template->error(); } else { $template->process($input, $vars_for_linux, 'ABC.cgi') || die $template->error(); } print "$0: do you want me to ftp it to remote site?...\n"