perl - how do I list contents of local directory on ftp? -


i trying send files remote host via perl script. want list local directory choose files upload iterate through files list using following commands:

my @files = '!ls'; not work @files = 'lls'; not work either 

then want do:

foreach $file (@files) { next if -d $file; next unless $file =~ /^gateway_data/; $ftp->put($file) or warn "failed '$file': $! ($^e)"; } 

is there command, apart 2 above, make list of files in local directory? assistance appreciated.

opendir(my $dir, './') or die $!; @files = readdir($dir); foreach $file (@files) {     next if -d $file;     next unless $file =~ /^gateway_data/;     $ftp->put($file) or warn "failed '$file': $! ($^e)"; } 

this should work.


Comments

Popular posts from this blog

java - Oracle EBS .ClassNotFoundException: oracle.apps.fnd.formsClient.FormsLauncher.class ERROR -

c# - how to use buttonedit in devexpress gridcontrol -

nvd3.js - angularjs-nvd3-directives setting color in legend as well as in chart elements -