Below is the small code snippet i have created using Hash Key and Hash Value which is an array. And my input is Hash value (Array in this case) , i have to search for all the arrays in $ENV hash and fetch the hash key
Example if i search for m3d1 , the output should be TEST3
use strict;
use warnings;
use Data::Dumper;
my %ENV;
$ENV{"TEST3"}=["m3d1","m3d2"] ;
$ENV{"TEST4"}=["m4d1","m4d2"] ;
$ENV{"TEST5"}=["m5d1","m5d2"] ;
$ENV{"TEST6"}=["m6d1","m6d2"] ;
print Dumper \@keys;
print Dumper \@values;
Is it possible , or is there a better design ?
%ENVas a variable name. There's an existing variable by that name.