my $dbh = Read_Huge_File_Into_DB( $huge_file_path ); my @customers = Process_Customer_Information_File( $dbh, $file_path ); Print_Report(\@customers); sub Process_Customer_Information_File { my $dbh = shift; my $file = shift; open( $info, '<', $file ) or die "Uh oh $!"; my @customers_found; while ( my $line = <$info> ) { my $customer_data = ParseCustomerData($line); my $name = $customer_data->[NAME]; if ( Customer_Found( $dbh, $name ) ) { push @customers_found, $customer_data; } } return @customers_found; }