open (my $in, $infile) or die; foo ($in); sub foo { my $file= shift; print $file "Some Stuff."; # note no comma }