in reply to Inserting an element into an array after a certain element

Combining map and ?: you can write this sub in one command:
sub insert_after_first { my ($count, $arr, $elt, $ins) = (0, @_); return map {($_ eq $elt and $count++ == 0) ? ($_,$ins) : $_} @$arr; }
Simply, yeah? And perlish enough, I hope.