in reply to split to get the dir name

Warning: Assumptions ahead. I may be entirely wrong.
From your example input, I'd hazard a wild guess that you're parsing the output of ls -l. I'm going to make the assumption that you're running ls -l with something like the backticks operator, and you're trying to parse the output.

If my above analysis is correct, then you're creating work for yourself, not to mention the person that would have to mantain it. A much more reasonable way to do what I'm assuming you want to do is:

use strict; use warnings; my $some_dir = "/tmp"; opendir(DIR, $some_dir) or die "can't opendir $some_dir: $!\n"; my @files = readdir(DIR); closedir DIR; print join "\n", @files;

If that looks useful, you may wish to look at perldoc -f readdir

cheers
davis
It's not easy to juggle a pregnant wife and a troubled child, but somehow I managed to fit in eight hours of TV a day.