1 sub foo 2 { 4a my $self = shift; 4b my () = @_; 3 } #### my $data_fh = IO::File->new($data_filename) || die "Cannot open '$data_filename' for reading: $!\n"; my $stuff = read_file_with_format($data_fh); ... my $second_fh = IO::File->new($second_filename) || die "Cannot open '$second_filename' for reading: $!\n"; my $other_stuff = read_file_with_format($second_fh); ... sub read_file_with_format { my ($fh) = @_; ... }