in reply to passing a file handle to a subroutine
sub getname{ $filename = $_[0]; print "Enter the name of the $filename: "; $x = <stdin>; chomp($x); return $x; } sub printscreen{ $input_file_name = $_[0]; open(infile, "<$input_file_name"); while(<infile>) { $line = $_; print "$line"; } }
|
|---|