use strict; use warnings; my $path_info = "/some_module/with/some/args"; my @module_args = split '/+', $path_info; print join(" :: ", @module_args), "\n"; __END__ :: some_module :: with :: some :: args