@dirs = ( # list from above ); foreach my $dir (@dirs) { my @singleDirs = split(/\//, $dir); # stuck }