in reply to Unlink files but not in pwd

Why use perl (unless this is homework)?
find "/path/of/dir" -name 'shell-type-glob-for-file' -delete
You can also use perl-type regex's with regex and regextype options

Replies are listed 'Best First'.
Re^2: Unlink files but not in pwd
by athanasia (Pilgrim) on Mar 27, 2009 at 16:01 UTC
    Hi Illuminatus,

    Thanks for your reply!

    Actually, this is a part of a bigger perl script. Of course, you are right, I could use unix's find in a system command, but that would mean shell invokation and I would prefer not to.

    Could you be more specific about your suggestion using regex options?

    Athanasia
      The options I mentioned are to find. Your initial post about having to prepend the path (also in another reply) does not seem all that odious. You could also check out File::Find