- or download this
# A 'wannabe' foreach, which:
# - takes a CODE ref as an optional first argument
...
# Plain funky again.
# wannabe_foreach(1..7);
- or download this
my $func = shift if ref $_[0] eq 'CODE'; # optional code-ref
- or download this
#my $func = shift if ref $_[0] eq 'CODE';
my $func = ref $_[0] eq 'CODE' ? shift() : undef;