#!/usr/bin/perl use strict; use warnings; use Net::FTPSSL; my %dirlist = (); my $win_ftp = "192.168.0.3"; my $homeftp = Net::FTPSSL->new ("$win_ftp", Port => 6500, Encryption => CLR_CRYPT, Croak => 1, ); $homeftp->login('test','test'); my @ret = $homeftp->nlst('',''); my $i = 0; for my $val (@ret) { $dirlist{$i} = $val; print $dirlist{$i}; $i++; }