im working with some perl code, and im really unfamiliar with the language, and I have a situation. I'm working with a package of perl scripts for a game, there are about 4000 of them and counting. They are release constantly, and altering their contents isnt really an option, it would just be too time consuming. That being said, here is an example of one that fits the situation i'm having.
sub EVENT_ITEM {
if($item1=="7880" && $item2=="7879" && $item3=="5192"){
quest::summonitem(4199);
quest::exp(85); }
}
This would normally be executed by the video game that would supply the EVENT_ITEM call, ass well as the summonitem, and exp functions.
I'm simmulating this invlovement on my site. There is a perl script that executes the EVENT_ITEM sub, and there are provodided summonitem and exp functions that instead spit out HTML that is returned to my php for display.
In essence they are able to simmulate game activities on the webpage before they try for real in the game.
The situation im having is with the $item1-$item4. They are hardcoded in the scripts(the ones i can't change). On the site, I will have 4 textboxes where they person can type these values in and submit them to the perl script. The issue is... if the user puts them in the wrong order the conditional wont execute. They might put item# 7880 in the 3rd box... and then it wouldnt function.
my question is this: Is there someway I can load multiple values into $item1-$item4? Something to the effect of an array that will evaluate every single value in a conditional. For instance in my main perl file that will simmulate execution of the EVENT_ITEM could I do something like
$item1=array(7880,7879,5192)
$item2=array(7880,7879,5192)
$item3=array(7880,7879,5192)
So when $item1==7880 it will check all three values before returning its true/false. Anyone got any idea?
Sorry for the length, i know im long winded.