in reply to Splitting file path

What does "splitting subdirectories" mean?

Replies are listed 'Best First'.
Re^2: Splitting file path
by Karger78 (Beadle) on Feb 10, 2010 at 22:04 UTC
    well any sub directorys underneeth I want split up into each element in the array.
      You're still not being very clear -- do you want just the directories one level below $hardPath or all directories below $hardPath? Do you want $hardPath included for each entry in the array or do you just want the part of the path that is below $hardPath? For example, given "$hardPath/foo/bar" do you want "$hardPath/foo" or "$hardPath/foo" and "$hardPath/foo/bar"? And do you want "$hardPath/foo" or just "foo"? That ambiguity is why you have been getting downvotes on your question.

      Elda Taluta; Sarks Sark; Ark Arks

      Using "splitting subdirectories" to explain "splitting subdirectories" is not very useful.

      Let's try something different. Give an example directory tree and show us what you want in the array.

      dir1\file1 dir2\file2 dir2\file3 dir2\dir3\file4
      should give
      @array = ( ???, ???, ???, ???, ???, ???, );
        ok. Perhaps it was a poor job explaining on my part. so we have a var called $hardPath. E.g \\test So what I would like to do is build an array of any sub directories within $hardPath. E.g $hardPath\foo\bar So then the array would contain foo, and bar. Does that make sense?