Bug 24545: Cannot return outside of sub
authorJonathan Druart <jonathan.druart@bugs.koha-community.org>
Mon, 9 Mar 2020 14:59:41 +0000 (15:59 +0100)
committerMartin Renvoize <martin.renvoize@ptfs-europe.com>
Mon, 9 Mar 2020 15:04:57 +0000 (15:04 +0000)
We must die instead

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

xt/find-license-problems.t

index 0df167d..de89e93 100755 (executable)
@@ -42,7 +42,7 @@ sub wanted {
 find({ wanted => \&wanted, no_chdir => 1 }, File::Spec->curdir());
 
 foreach my $name (@files) {
-    open( FILE, $name ) || return 0;
+    open( FILE, $name ) || die "cannot open file $name $!";
     my ( $hascopyright, $hasgpl, $hasv3, $hasorlater, $haslinktolicense,
         $hasfranklinst, $is_not_us ) = (0)x7;
     while ( my $line = <FILE> ) {