Hmmm... but wouldn't it immediately change
again as soon as the callback exits, anyway, as the
foreach goes into its next iteration? I was thinking
more along the lines of whether the order of either of
the two arrays is (or is supposed to be) significant,
whether said order might be changed by any of the
callbacks,
whether the callbacks are (or are supposed to
be) idempotent, and so on -- all of which requires
knowing what the arrays contain or are supposed to
contain.
;$;=sub{$/};@;=map{my($a,$b)=($_,$;);$;=sub{$a.$b->()}}
split//,".rekcah lreP rehtona tsuJ";$\=$;[-1]->();print