Hi, I have the following perl code :
use strict;
use warnings;
use Test::Cmd::Common;
my $path = "/something/not/available";
my $test = Test::Cmd::Common->new(string => 'File system operations');
eval{
$test->unlink("$path");
};
ok(!$@, "file unlike");
print "done.\n";
The $test->unlink() line will fail and throw exception. but the problem : eval is not handling that exception and the code execution is being interrupted.
the output :
$ perl test.pl
could not unlink files (/something/not/available): No such file or directory
NO RESULT for test at line 561 of /home/y/lib/perl5/site_perl/5.8/Test/Cmd/Common.pm (Test::Cmd::Common::unlink)
from line 9 of test.pl.
Is eval doing the right job here? or I am misunderstanding something?
F.