package Cheesy; use strict; use warnings; use Exporter; our (@ISA, @EXPORT_OK); @ISA = qw(Exporter); @EXPORT_OK = qw( grep map ); sub grep (&\@) { my $code = shift; my $ref = shift; return CORE::grep &$code, @$ref if defined wantarray; @$ref = CORE::grep &$code, @$ref; } sub map (&\@) { my $code = shift; my $ref = shift; return CORE::map &$code, @$ref if defined wantarray; @$ref = CORE::map &$code, @$ref; } 1;