On Fri, Sep 5, 2008 at 2:09 PM, brian54321uk <[EMAIL PROTECTED]>wrote:

> HI again
> I would like to test a folder full of files, and if a file contains
> abc123blue or xyz357green then that file is to be deleted.
> What would be the best way of achieving this please?
>
> If however, it would be simpler for the script to empty the files contents,
> that's not a problem as I have another script that I can run which deletes
> empty files.
>
> thanks
> Brian
>
> --
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> http://learn.perl.org/
>
>
> you can do something like this.

for (glob("folder/*")) {
 unlink if m/abc123blue|xyz357green/;
}

Reply via email to