Re: string comparison
- From: "Tassilo v. Parseval" <tassilo.von.parseval@xxxxxxxxxxxxxx>
- Date: Fri, 30 Sep 2005 21:53:49 +0200
Also sprach Anno Siegel:
> Gunnar Hjalmarsson <noreply@xxxxxxxxx> wrote in comp.lang.perl.misc:
>> Babacio wrote:
>> > But if I guess what you really want to do, try that :
>> >
>> > if ($a eq 'apple' || $a eq 'banana') { etc }
>>
>> or this:
>>
>> if ( grep $a eq $_, ('apple', 'banana') ) {
>>
>> (perldoc -f grep)
>
> ...or use Quantum::Superposition
Yuck. I'd suggest
use List::MoreUtils qw/any/;
if (any { $a eq $_ } qw/apple banana/) {
Tassilo
--
use bigint;
$n=71423350343770280161397026330337371139054411854220053437565440;
$m=-8,;;$_=$n&(0xff)<<$m,,$_>>=$m,,print+chr,,while(($m+=8)<=200);
.
- References:
- string comparison
- From: Shashank Khanvilkar
- Re: string comparison
- From: Gunnar Hjalmarsson
- Re: string comparison
- From: Anno Siegel
- string comparison
- Prev by Date: Re: equality as a variable
- Next by Date: Re: website development and maintenance, using Perl. Please help!
- Previous by thread: Re: string comparison
- Next by thread: protect calling files directly?
- Index(es):