#Untested.. my %foo = ( IP => "2.3.4.5" ,USER => "Someone" ,PASSWORD => "Bad Idea" , .. etc ... ); my $returned = $foo{$ARGV[0]}; print .. etc ..