in reply to Re: Saving my output to a folder
in thread Saving my output to a folder

Thank you so much. I really appreciate. You're a lifesaver.

Replies are listed 'Best First'.
Re^3: Saving my output to a folder
by NetWallah (Canon) on Apr 19, 2016 at 21:40 UTC
    If you will be running this script multiple times, each run will overwrite the previously saved ppid.

    If you want to preserve/append to the PPID instead, use this construct to open the file in "append" mode:

    open my $wfh, '>>', "$dir/$outfile" or die "ERROR: Can't open/append the damned output file! The OS says +:$!";

            This is not an optical illusion, it just looks like one.

      Thanks, If I want to add every new scanned PPID as a new text file in that folder what should I do? Like having a list of text files in the destination folder. I will really appreciate any help.
        Yes - this is trivial:
        open my $wfh, '>', "$dir/$input" or die "can't open the damned output file! $!";

                This is not an optical illusion, it just looks like one.