my $id = 23; my $name = "foo"; my $data  = get_data_from_db($id, $foo); my $items = get_other_data($id); my $new_data = merge($data, $items); sub get_data_from_db {  my ($id, $name) = @_;  # some checks on $id and $name  # database conncetion  # prepare  # get rows  # do something with rows  # ... return $result; } sub get_other_data {  # long subroutine... } sub merge {  # long subroutine... }