Subject: | exit override has wrong precedence / prototype |
% perl -e 'my @x = 0; exit @x'; echo $?
1
% perl -e 'use Test::Exit; my @x = 0; exit @x'; echo $?
0
These two should produce the same output.
% perl -e 'exit 0 | 1'; echo $?
0
% perl -e 'use Test::Exit; exit 0 | 1'; echo $?
1
As should these.
Test::Exit's 'exit' override lacks CORE::exit's (;$) prototype that gives it higher precedence and forces scalar context on the argument.