Subject: | Should not exit in BEGIN block |
t/210_images.t fails if there's no DISPLAY:
$ perl t/210_images.t
1..0 # SKIP Test irrelevant without a display
_TK_EXIT_(0)
BEGIN failed--compilation aborted at t/210_images.t line 44.
Problem is the implicit exit() (which is done by plan skip_all => ...) within the BEGIN block. It can be reduced to:
$ perl -MTk -e 'BEGIN { eval { tkinit }; exit }'
_TK_EXIT_(0)
BEGIN failed--compilation aborted at -e line 1.
It seems that Tk.pm introduces some special exit() handling which breaks inside a BEGIN block. But I think you can drop the BEGIN{} block here, and do all the checks here outside.