in reply to boolean IN(); function in perl like
I can't resist
#!/usr/bin/perl -wl use strict; sub in { my $h = pop; @_ && ($h eq pop or in(@_, $h)) } my @a = qw(a b c d e f g h); print in(@a, $_) . " for $_ in (@a)" for qw(a c f v d s);
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: boolean IN(); function in perl like
by EvilSuggestions (Acolyte) on Jan 18, 2005 at 21:53 UTC |