pragovnj has asked for the wisdom of the Perl Monks concerning the following question:
I have inherited a old perl script which I need to modify. The old script had two sets of files but in a single directory ("EDS/CUCP/SIP";). Also, the Source ($SRC_DIR) and Destination dir ($DST_DIR ) was the same. But in the new, the files are from two diff directories ("$VTIERBASE/pvc/ohdr/topology","$VTIERBASE/pvc/ohdr/instance-0/preprocess"). Also, the destination is different. How do I combine the files from two dir in the $SRC dir? I tried it as my@dir my @dir = ("$VTIERBASE/pvc/ohdr/topology","$VTIERBASE/pvc/ohdr/instance-0/preprocess"); foreach my $SRC_DIR(@dir) { But it is not working. The files are from /opt/app/vcc/pvc/ohdr/topology and /opt/app/vcc/pvc/ohdr/instance-0/preprocess for example, aaa.txt, bbb.txt are from the first dir and PM_aaa.txt, PM_bbb.txt are fro second dir.
Thanks, Pragovmy $VTIERBASE = "/opt/app/vcc"; ................................... #my $SRC_DIR = "EDS/CUCP/SIP"; # must prepen +d $VTIERBASE/Data/Ready if not fully specified my @dir = ("$VTIERBASE/pvc/ohdr/topology","$VTIERBASE/pvc/ohdr/ins +tance-0/preprocess"); foreach my $SRC_DIR(@dir) { my $DONE_DIR = "$VTIERBASE/pvc/ohdr/instance-0/cucp"; + # must prepend $VTIERBASE/Data/Done + if not fully specified #my $DST_DIR = "EDS/CUCP/SIP"; # must prepen +d $VTIERBASE/Data/Ready if not fully specified my $DST_DIR = "$VTIERBASE/pvc/ohdr/instance-0/processed"; my $LOG_DIR; # must prepend + $VTIERBASE if not fully specified my $LOG_DIR = "$VTIERBASE/logs/DCCC/ohdr"; my $EMAIL_DL; #my $CONFIG_FILE; my $CONFIG_FILE = "$VTIERBASE/config/ohdr"; my @feed_files; .............................
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: To read files from two dir
by GrandFather (Saint) on Apr 11, 2022 at 20:55 UTC | |
by pragovnj (Acolyte) on Apr 13, 2022 at 18:12 UTC | |
by Fletch (Bishop) on Apr 13, 2022 at 18:26 UTC | |
| |
by GrandFather (Saint) on Apr 13, 2022 at 21:08 UTC | |
| |
Re: To read files from two dir
by graff (Chancellor) on Apr 12, 2022 at 03:00 UTC | |
Re: To read files from two dir
by Ratazong (Monsignor) on Apr 12, 2022 at 07:13 UTC | |
Re: To read files from two dir
by cavac (Prior) on Apr 12, 2022 at 11:28 UTC |