use strict;
use warnings;
my @hosts = (
{ 'name' => 'Site 1', 'host' => 'hostname1' },
{ 'name' => 'Site 2', 'host' => 'hostname2' },
{ 'name' => 'Site 3', 'host' => 'hostname3' },
## Etc...
);
while (1) {
print "Please pick which system you wish to FTP to:\n";
print $_+1, ') ', $hosts[$_]{'name'}, "\n" for 0..$#hosts;
print "Q) Quit\n\n";
chomp($_ = <STDIN>);
last if uc($_) eq 'Q';
dftp($hosts[$_-1]{'host'});
print "\n";
}
Since you probably want them in a specific order, the outer structure should be an array. Since you might want to add more data about each item in the future, and don't want to have to worry about order, the inner structure should be a hash.