Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Re: To read files from two dir

by Ratazong (Monsignor)
on Apr 12, 2022 at 07:13 UTC ( [id://11142930]=note: print w/replies, xml ) Need Help??


in reply to To read files from two dir

Hi Pragovnj,

Will there be only one additional source? If so, the easiest way would be to duplicate the code accessing the directory ...

# original part my $SRC_DIR = "EDS/CUCP/SIP"; # put real path h +ere my $DST_DIR = "EDS/CUCP/SIP"; # put real path h +ere ... all the code working on that directories # copy $SRC_DIR = "EDS/CUCP/SIP2"; # put real path +here $DST_DIR = "EDS/CUCP/SIP2"; # put real path +here ... copy of all the code working on that directories

Of course code duplication is usually a bad idea (if you need to change something, that change needs to be done in all copies), so use it carefully. Especially, if you forsee the requirement to have more than two sources in the future.

HTH, Rata

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others lurking in the Monastery: (3)
As of 2024-04-26 06:08 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found