$ perl -le 'print sub{print 1; "x"}->(), sub{print 2; "y"}->()' 1 2 xy