in reply to Looking Through Arrays?
This uses hashes as sets. This is quick and easy, because hashes intrinsically support most set-related operations, such as exists.my @AllowedRanks = qw( Recruit General Captain Civilian Airman ); my %allowed_ranks; @allowed_ranks{ @AllowedRanks } = (); # define a set if ( exists $allowed_ranks{ $MemberCall } ) { # test set membershi +p Welcome(); } else { NotWelcome(); }
jdporter
...porque es dificil estar guapo y blanco.
|
|---|