in reply to Smart match operator question

I don't know if smart match can do this, but you could consider List::MoreUtils:
use warnings; use strict; use List::MoreUtils qw(firstidx); my @list = (1, 4, 3, 2, 4, 6); printf "item with index %i in list is 4\n", firstidx { $_ == 4 } @list +; __END__ item with index 1 in list is 4