Creative code reuse AKA cheating (#5 and #6):
#!/usr/bin/env perl use strict; use warnings; use English; use feature qw(say); sub any (&@); my $item = 'ABA'; my @items = qw(ABA SCO ACC PHC GHF); if ( any { $ARG eq $item } @items ) { say q(Cool!); } else { say q(Crap!); } sub any (&@) { my $f = shift; foreach (@_) { return 1 if $f->(); } return 0; } __END__
Best regards, Karl
«The Crux of the Biscuit is the Apostrophe»
perl -MCrypt::CBC -E 'say Crypt::CBC->new(-key=>'kgb',-cipher=>"Blowfish")->decrypt_hex($ENV{KARL});'Help
In reply to Re: Sparing multiple 'or's
by karlgoethebier
in thread Sparing multiple 'or's
by Denis
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |