perl - Quick question.

Posted on Tue Sep 2 00:23:48 2008 by construct
Quick question.
New to the perl scripting engine and scripting a plugin for personal use for xchat on linux fedora 9. After figuring quite a bit out myself in the short time I've been working on it I was curious if there's a specific way to check quickly and painlessly if a number appears in an array such as:
elsif ($oaccess{$onick} eq 1-4) { commands; }
Where as $onick appears as their oper nick and $oaccess is the array I wish to check if 1-4 appears at access $onick.
my %oaccess = (Construct => "4", e3zy => "3", Seth => "1", Kim => "3", honey => "1", Cop => "4");
Reason because I want all users with access between 1-4 to have access to area then
elsif ($oaccess{$onick} eq 2-4) { commands; }
drop another access level change for higher access only commands. If theres a quick way to do this directly in the if statement I would love to know it as I already use a for method n such for the other two arrays and want to try and prevent more higher loop functions. I also want to prevent from doing a long drawn out If statement if possible such as.
elsif ($oaccess{$onick} eq 1 or $oaccess{$onick} eq 2 or $oaccess{$onick} eq 3...) { commands; }
Just seems a bit pointless to draw it out so much... Thanks to anyone that can help.
Write a response