#!/usr/bin/perl

$tpl = "host.tpl";
$result = "vhost";

$uhost = "bla";
$nuser = "moi";

open IN, $tpl;
open OUT, "> $result";
while ($ligne = <IN>) {
        $ligne =~ s/\@uhost\@/$uhost/g;
        $ligne =~ s/\@nuser\@/$nuser/g;
        print OUT $ligne;
}
close IN;
close OUT;