Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re^5: Net::SFTP::Foreign getting files

by salva (Abbot)
on Apr 11, 2013 at 15:14 UTC ( #1028181=note: print w/ replies, xml ) Need Help??


in reply to Re^4: Net::SFTP::Foreign getting files
in thread Net::SFTP::Foreign getting files

yes, glob also accepts Perl regular expressions:

... my $start = quotemeta "$file$yesterday"; my ($file) = $sftp->glob(qr/^$start\d{6}$/, names_only => 1); ...
But there are easier ways to do what you want. For instance, you can use a regular expression matching all the prefixes in @ai_files_day plus $yesterday plus any six digits and let mget download all the files matching:
$sftp->setcwd($ai_dir); my $starts = join('|', map quotemeta, @ai_files_day); $sftp->mget(qr/^(?:$starts)$yesterday\d{6}$/, $ai_dest_day);


Comment on Re^5: Net::SFTP::Foreign getting files
Select or Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1028181]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (8)
As of 2015-07-03 03:09 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (47 votes), past polls