in reply to Re: Re: Re: What is the perl equivelant to a 'Set' column type in mysql?
in thread What is the perl equivelant to a 'Set' column type in mysql?

I think you missed the part where I used the sequential numbers as a count for which bits to set or check; if not please elaborate, as I don't see the bug. In fact, the example I gave is a jazzy pop singer, and it works properly.

Using powers of 2 for the constants is a good idea, though; I just thought it would be easier to explain this way.

  • Comment on Re: Re: Re: Re: What is the perl equivelant to a 'Set' column type in mysql?

Replies are listed 'Best First'.
Re: Re: Re: Re: Re: What is the perl equivelant to a 'Set' column type in mysql?
by tachyon (Chancellor) on May 01, 2004 at 21:28 UTC

    My mistake, I did not read the code carefully and ignored the bitshift logic ;-). I use OR logic for my masks

    my %genres = ( ROCK => 0, POP => 1, JAZZ => 2, } my $bits = 0; $bits |= $genres{$_} for @spec;

    cheers

    tachyon