pulling specific values from hash - Programmers Heaven

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

pulling specific values from hash

kwnkwn Posts: 1Member
Howdy I'm a beginner so my question is probably dumb but I appreciate any help thanks.
The problem I have here is that i need to grab a specific value of the [color=Grey]%locs[/color] hash based on what [color=Blue]my[/color] [color=Orange]$loc[/color] =
As you can see [color=Blue]my[/color] [color=Orange]$loc[/color] = so if the input is: "one" at the second prompt then i need the 'c$files' value

[color=Blue]my[/color] [color=Grey]%locs[/color] = (one => 'c$files', two => 'd$stuff', three=> 'd$ hings');
[color=Blue]my[/color] [color=Grey]%servers[/color] = (ksl => '\server1', krf => '\server2');

[color=Blue]my[/color] [color=Orange]$server[/color] = ;
[color=Blue]chomp[/color] [color=Orange]$server[/color];
[color=Blue]my[/color] [color=Orange]$loc[/color] = ;
[color=Blue]chomp[/color] [color=Orange]$loc[/color];


Sign In or Register to comment.