sub print_tempDB_report_from_file { my ($DB_FName, $RPT_FName) = @_; my $tempDB = parse_db_file($DB_FName); my $report = generate_db_report($tempDB); open my $OFH, '>', $RPT_FName or die "meaningless death!"; print $OFH $report; } sub parse_db_file { my $DB_FName = shift; . . . code to parse DB File into data structure . . . return $tmpDB; } sub generate_db_report { my $tmpDB = shift; my $text; . . . code to turn data structure into a string . . . return $text; }