Hi,

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.

my $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; .............................
Thanks, Pragov

In reply to To read files from two dir by pragovnj

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.