Challenge: Why bother with the overhead cost of creating a List::Compare object?
Response: A faster but less elegant interface: List::Compare::Functional
use List::Compare::Functional qw( get_union get_complement );
@union = get_union( [ \@Al, \@Bob, \@Carmen, \@Don, \@Ed ] );
No constructor, so lists must be passed each time a function is called.
References to lists are themselves placed in a list. A reference to that is passed to the function.
Where a function needs extra arguments, these must also be wrapped in an array which is passed by reference to the function.
@complement_Don =
get_complement( [ \@Al, \@Bob, \@Carmen, \@Don, \@Ed ],
[ 3 ] );
Previous | Back to start of show | Next |
Slide: 14 functional | © 2004-18 James E. Keenan |