Often you'll want to accept a subroutine that operates on $_, like map and grep do. The details of getting $_ to work that way are inconvenient to worry about every time, so this module abstracts that away. Transform the subroutine that touches $_ with transform, and then treat it as though it is operating on $_[0].

This means you can write your subroutine as though it were the first argument of map or grep, but execute it like $sub-($arg)>.

Everything works exactly the same as map or grep -- $_ is localized, but aliased to whatever you call the subroutine with. That means that modifying $_ in $sub will modify the argument passed to the transformed sub, but won't touch the $_ that already exists.