Thank you, again. The issue is here reading each filename from the directory and do compare. If it matches process all three files and then create a new *.done file to process further. This script runs once a week so we do not worry about old files. because there will always be three files will dropped in the source folder where this script should look after at specific interval.

I made some changes as advised but it is not throwing any error but eventually end up with Exit code 0.
$inputFileName = $ARGV[0]; $inputFilewithPath = $ARGV[1]; $destinationFileName = ""; $destinationFilePath = "\\mftshare-dev\Test\customoutput\Test1"; $triggerFileName = ""; my @zipfiles = glob "\\mftshare-dev\cpa\customoutput\hubidp\*.zip"; for my $file (@zipfiles) { if ($inputFileName =~ /alphat_(.*)\.zip/) { my $key = $1; # whatever was between alphat_ and the .zip bits. if (-f "numerict_${key}.zip" && -f "updatet_${key}.zip") { $destinationFileName = sprintf("%s%s%s", $destinationFilePath, + $inputFileName); $triggerFileName = sprintf("%s%s%s", $destinationFilePath , "c +pa_trigger.done"); $returnVal = system("ftmscmd /tcp /send /file /node:VIP /DT:B +/CrLf:Y /ppa1:S,L,COMMAND,\"echo > $triggerFileName\" /TC:3 $inputFil +ewithPath $destinationFileName"); } else { printf "WARNING: EXPECTED FILES NOT FOUND. INVESTIGATION REQUI +RED"; exit 8; } } }

In reply to Re^5: Check multiple file names exist in directory and create another trigger file after existing files processed by vickycanada
in thread Check multiple file names exist in directory and create another trigger file after existing files processed by vickycanada

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.