my $full = '/usr/local/jboss'; my ($path, $tail) = $full =~ m|^(.*/)(.*?)$|; print "Path: $path\n"; print "Tail : $tail";