in reply to deleting a list of files

This node falls below the community's threshold of quality. You may see it by logging in.

Replies are listed 'Best First'.
Re: Re: deleting a list of files
by a (Friar) on Mar 25, 2001 at 10:29 UTC
    If you:
    opendir(ims, ...
    your dir handle is "ims", as in 'readdir ims'. The grep is to remove unix files . and .. the current and parent dir links. readdir returns just the filenames, not the whole path, so your chdir will work, but so should his prepend of the path, as in (perldoc -f readdir):
    opendir(DIR, $some_dir) || die "can't opendir $some_dir: $!"; @dots = grep { /^\./ && -f "$some_dir/$_" } readdir(DIR); closedir DIR;

    a