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


in reply to pairwise() doesn't seem to work...

You need to import pairwise from List::MoreUtils. It seems that Perl interprets pairwise { ($a, $b) } as indirect object notation otherwise:

use List::MoreUtils qw( pairwise );