in reply to Sub Params as references

The problem in your is with extracting the sub parms from  @_. With
my $file_name = ${shift()}; my $lines_in = ${shift()};
you are copying your dereferenced references into new local variables, which does not update the variables in the caller. Try instead
sub read_template { my $file_name = shift; my $lines_in = shift; my $line_cnt = 0; if (!open (INPUT, "< $$file_name")) { die "Can't open $file_name as input."; } else { while (<INPUT>) { $line_cnt++; $$lines_in .= $_; } close (INPUT); } return($line_cnt); }
This approach keeps the references and updates the caller's variables.

-Mark