in reply to Trying to compare a string...
That's not how || works. The general pattern is
condition || condition || condition
So, you have to repeat the whole condition each time:
if ($genres[0] eq 'Science Fiction' || $genres[0] eq 'Sci-Fi' || or $g +enres[0] eq 'Fantasy') {
If you think it is a bit verbose, switch to some other way of checking the values:
# Either if ($genres[0] =~ /^ (?: Science\ Fiction | Sci-Fi | Fantasy ) $/x) { # or if (grep $genres[0] eq $_, 'Science Fiction', 'Sci-Fi', 'Fantasy') {
etc.
لսႽ† ᥲᥒ⚪⟊Ⴙᘓᖇ Ꮅᘓᖇ⎱ Ⴙᥲ𝇋ƙᘓᖇ
|
---|
In Section
Seekers of Perl Wisdom