$input = getInput() # and your subroutine are defined as sub getInput{ ... } ...