(eg key-> username value-> someusername)
The verify subroutine will then first look at a key, determine what the key's name is, and finally evaluate whether that key's value fits a certain regular expression.
I'm not asking anyone to write this entire script out, I would actually like to do that myself. What I do need is an example or explanation of how to pass a reference to a hash into a subroutine, and then how to access that hash's keys and values through the passed reference. I looked online for examples, but there weren't any specific enough to help me.
Thanks in advance to anyone, sorry if I rambled on too much!
essentially, if you have a %hash, you can use the backslash operator to create a reference, like:
$hashref = \%hash;
then pass the $hashref in the subroutine argument list and access values as $hashref->{'KEYVALUE'} or $hashref->{$keyref}