sub get_path { my $path = shift; # Retrieve the argument. print STDERR "DEBUG: Got '$path'"; # Show you got it correctly. } get_path('a/bcd/sample/array.list'); # Pass the argument.