braintree/braintree_perl — pull request #2 by pilcrow (2012-05-08 05:34:10+00:00)
Title: Example module modernization/cleanup

...and I don't mean Modern::Perl. :)

The non-Moose modules under `lib/Net/Braintree` can be tightened a bit, and lose some of their boilerplated cruft. These changes to Util demonstrate.

`use vars` and `our $whatever` are at odds. Exporter can do its work *without* being inherited. An empty `@EXPORT_OK` is a distraction. (Candidly and IMHO, `@EXPORT` ought to be omitted and only `@EXPORT_OK` populated.)

`difference_arrays` was a skosh inefficient. Some more perlish idioms were substituted.

Most seriously, I dropped the double wiggle operator (~~ or "smart match") from `contains()`. The elements of `@this = (undef,)` and `@that = ('',)` will compare equal via `eq` (the < 5.10 implementation), but those two arrays are _not_ double wiggle equal.