Indeed, "and" is instead a valid logical operator. You had me scratchin' my head trying to figure out what you meant, but I assume perl -c barfed on it because I placed the scalar values meant to be an array within brackets rather than parentheses. Serves me right for not bouncing it against Perl.
Code:
($headid ~~ (147587,147580,147573,147566) and ...
I left the comments in so the numbers didn't appear so random. Though, they may still appear random even if:
Code:
my @headpieces = (147587,147580,147573,147566);
if ($headid ~~ @headpieces) {
As aforementioned, I would consider doing a Hash of Hashes.
Maybe something along the lines of:
Code:
%HoH = (
'leather' => {
'head' => 147587,
'chest' => 147588,
'legs' => 147591,
},
'plate' => {
'head' => 147580,
'chest' => 147581,
'legs' => 147584,
},
'chain' => {
'head' => 147573,
'chest' => 147547,
'legs' => 147577,
},
'cloth' => {
'head' => 147566,
'chest' => 147567,
'legs' => 147570,
},
);
Though the nice thing about Perl and Eqemu in general, there are so many ways one can approach a problem to reach a solution. Sure, there are "better" ways, or perhaps even correct. For instance, placing the
Code:
my %elementshash = map { $_ => 1 } @headpieces;
if(exists($elementhash{$headid})) {
I am looking forward to see what you have cooking up superpally1. Assuming it's going to be a public server.