# Print the given template sections to the supplied filehandle sub printto { my $self = shift; my $fh = shift; my $ret = 0; my($val,$sec,$v); for(;@_;shift) { $sec = $self->[_sec]{$_[0]}; if (!defined($sec)) { print $fh $self->_nosuchsec($_[0]); next; } $ret++; foreach $v (@$sec) { if ($v->[_type] == type_text) { print $fh $v->[_contents]; } else { $val = $self->[_assign]{$v->[_contents]}; print $fh defined($val) ? $val : $self->_nosuchvar($val,"\$".$val); } } } $ret; }