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