http://www.perlmonks.org?node_id=969018


in reply to Re^3: string diff and compare
in thread string diff and compare

There are other ways of enforcing scalar context which are a lot more fun. :-)

use 5.010; use strict; use warnings all => 'FATAL'; my ( $old, $new ) = qw( old new ); my ( $rold, $rnew ) = map~~reverse, $old, $new; say for "$old => $rold", "$new => $rnew";
perl -E'sub Monkey::do{say$_,for@_,do{($monkey=[caller(0)]->[3])=~s{::}{ }and$monkey}}"Monkey say"->Monkey::do'