I am new to perl (first language so no programming background either) and need help solving a problem I am having. I am writing some code to check DNS records and I am stumped here. I an trying to create a hash from user input. Here is the code, for some reason I can not populate the hash (keys or values) using a variable. Any help is appreciated.
NOTE: print statements were for debugging :)
$count = 0; foreach (@rawdata) { #Remove newline if ($count == 0) { $key = $_; $count++; chomp $key; print "Key: $key<br>"; next; } if ($count == 1) { $value = $_; $count++; chomp $value; print "Value: $value<br><hr>"; } if ($count == 2) { $ipkey{'$key'} = '$value'; $count = 0; print $ipkey{$key}; } }
In reply to Creating hash with variables by vonedaddy
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |