local *do_somthing = sub { my $list_ref = shift; my $menu_ref = shift; my $status_ref = shift; my $selected; my $blah; my $selected_num = $$menu_ref{'selected'}; my ($id, $menu) = split(/ /,$$menu_ref{'title'}); $selected = $$menu_ref{'list'}{$selected_num}; print "$selected\n"; $selected =~ s/\s+$//g; if ($selected eq "VIEW CONFIGURATION") { $blah = &external_subroutine($id); $$status_ref{"content"} = $blah; } elsif { $$status_ref{"content"} = "HRMM"; } }; ..... ..... ..... outside this whole block of code sub external_subroutine { my $id = @_; # IM THINKING THIS MAY BE THE PROBLEM $id =+ 10; return $id; }