use constant CODE=>0; use constant SUBCODE=>1; ... #### use constant { CODE=>0, SUBCODE=>1, .... }; #### if( $response[CODE] == 20 and $response[SUBCODE] == 55 ) { # Do something appropriate } #### if( "@response[CODE, SUBCODE]" eq '20 55' ) { # do stuff }