Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

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

by salva (Monsignor)
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 about the Monastery: (11)
As of 2014-10-02 06:36 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    What is your favourite meta-syntactic variable name?














    Results (49 votes), past polls