http://qs321.pair.com?node_id=912138


in reply to Re^4: Filling in missing values in an array
in thread Filling in missing values in an array

If you don't want the code to die, you need to use something to catch the exception. I like Try::Tiny:
use Try::Tiny; my @bad = try { fill_in_the_blanks(qw<_ _ _>) } # fails catch { print "bad data!\n" }; my @good = try { fill_in_the_blanks(qw<_ 1 _>) } # succeeds catch { print "bad data!\n" };