# declare a function sub my_function_name { # Your input parameters will be in the array @_... my $first_arg = shift(@_); my @remaining args = @_; # Then do whatever you want here... print "Hello, world\n"; # And return data return "Whatever you want to\n"; } # And then you call it like this: my_function_name("First argument", "the", "rest", "of", "them");