http://www.perlmonks.org?node_id=636082


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

For the sake of completeness, you can also use an anonymous sub :
unlink $file or sub { print 'Error!'; push @list, $file; }->();
Using unless or a do block would be the preferred way though.
Also, don't call subs with & unless you've read perlsub and you've understood what it does.