in reply to Re: •Re: One liner to Check and undef hash elements
in thread One liner to Check and undef hash elements

sub { ... } as an expression returns a reference to an anonymous function. ->(@list); takes a reference to an anonymous function and calls it. So what happens when you chain them is you define an anonymous function and call it on the spot, the anonymous function being lost, because you didn't save the reference anywhere.

Makeshifts last the longest.

  • Comment on Re^3: One liner to Check and undef hash elements ( sub { .. }->() explained)