Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Re^4: Looping through multiple directories

by Athanasius (Archbishop)
on Dec 26, 2017 at 10:15 UTC ( [id://1206196]=note: print w/replies, xml ) Need Help??


in reply to Re^3: Looping through multiple directories
in thread Looping through multiple directories

That’s not my way!

my $dirs1 = </cygdrive/c/Users/attwwwe1/Documents/dude/logs/*.logs>; my $dirs2 = </cygdrive/c/Users/attwwwe1/Documents/dude/logs2/*.logs>;

If you’ve decided to glob each directory separately, you need to store the results of each glob operation in an array, not a scalar:

my @logs1 = </cygdrive/c/Users/attwwwe1/Documents/dude/logs/*.logs>; my @logs2 = </cygdrive/c/Users/attwwwe1/Documents/dude/logs2/*.logs>;

And then you don’t need to glob again; just put the names of all the log files into @ARGV:

@ARGV = (@logs1, @logs2);

Hope that helps,

Athanasius <°(((><contra mundum Iustus alius egestas vitae, eros Piratica,

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others perusing the Monastery: (6)
As of 2024-04-23 09:10 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found