Me gustaría verificar sí un parámetro en mi código es igual a una llave con el mismo nombre que tengo dentro de una tabla hash. ¿Cómo puedo hacer esto? Por cierto, estoy trabajando con Perl.
¡
Verificar llave en una tabla hash
Iniciado por
Alberto Hernandez
, feb 13 2014 22:23
#1 AUTOR PREGUNTA
Esto también te interesa!
#2
Publicado 14 febrero 2014 - 20:16
la idea es hacerlo con el operador condicional del lenguaje, te dejo como hacerlo:
while ( <PARAdef> ) {
chomp;
my ($PGllave, $PGval) = split /\s+=\s+/;
print "$PGkey = ",
$PGval eq $hash{$PGllave}[$id] ? $hash{$PGllave}[$id] : $PGval, "\n";
}