in reply to Re^2: Having trouble returning the correct values from my sub
in thread Having trouble returning the correct values from my sub

Then why pass $k?

Also, you don't get values, you get exactly one value from get_directory(), because as soon as your regex matches, you're leaving the routine (and thus the foreach loop within the routine)...

Replies are listed 'Best First'.
Re^4: Having trouble returning the correct values from my sub
by lomSpace (Scribe) on Feb 27, 2009 at 20:00 UTC

    True! I am getting only one value. I will try another for
    loop.