in reply to split to get the dir name

Hi,

Please forgive if you know this already, especially as it doesn't address your immediate question. The rest of the comments to this point should very readily help you through your current problem...but getting the contents of a directory is more easily, quickly and safely done without handing off to a shell.

my @filelist = glob './*'; #get filelist of curdir

,welchavw

Replies are listed 'Best First'.
Re: Re: split to get the dir name
by NetWallah (Canon) on Sep 29, 2003 at 17:32 UTC
    I was about to whine that welchavw's code would not produce the right results in the Win32 environment, but it does!. I wonder how it would fare on the Mac - seems like it should work there too.

    Anyway - here is a minor variation on his code to enable processing/printing:

    foreach( glob './*'){ print qq($_\n); # if necessary # Do some work with the file name (available as $_) };