in reply to unlink $file OR... OR..

What's wrong with using a sub? If you really don't want to, make it a block:

if ( ! unlink $file ) { warn "Can't unlink '$file': $!\n"; push @unlink_failures, $file; }

If you want it shorter, maybe:

@unlink_failures = grep { ! unlink } @files_to_unlink; warn "unlink failed for '$_'\n" for @unlink_failures;

I guess that could be all one line (though I haven't tried this) this way:

warn "unlink failed for '$_'\n" for ( @unlink_failures = grep { ! unlink } @files_to_unlink );

...but that's getting pretty convoluted (and it loses the error messages from $!). I recommend the block.