1 #!/usr/local/bin/perl -pli.orig
 
   4 # perlcode -> template converter
 
   6 # there's ugly perl generated html in your xy.pl?
 
   7 # no problem. copy&paste it into a separate html file, remove 'qq|' and '|;' and use this script to fix most of the rest.
 
   9 # use: perl pl2tmpl.pl <file>
 
  11 # will save the original file as file.orig
 
  14 s/\$form->\{(?:"([^}]+)"|([^}]+))\}/[% $+ %]/g;
 
  15 s/\| \s* \. \s* \$locale->text \( ' ([^']+) ' \) \s* \. \s* qq\|/<translate>$1<\/translate>/xg;
 
  16 s/\| \s* \. \s* \$locale->text \( " ([^"]+) " \) \s* \. \s* qq\|/<translate>$1<\/translate>/xg;