sub format_output { my ($var1, $var2, @array) = @_; # do_some_stff } format_address(":", 0, (split(//, $scalar))[8 .. 13]);