in reply to Sub Params as references

You've copied the value pointed to by the reference. When you copy a reference, you're still pointing to the same value. When you copy a dereference, you get a fresh copy of the value.

my $file_name = shift; my $lines_in = shift; # skip a few $$lines_in .= $_;