in reply to Re: Checking for Files
in thread Checking for Files

Hello Richard, That works - thanks... However, I am only getting the results for the first line in my input file. Thanks.

Replies are listed 'Best First'.
Re^3: Checking for Files
by aaron_baugher (Curate) on Nov 18, 2011 at 15:11 UTC

    You're opening your output file inside your while loop, so it's getting closed and then wiped out and reopened for each line of your input file. So you're actually getting the size and date of the last file listed in your input file, not the first. Open your output file outside your while loop, as you do with your input file, and that should fix that.

    Aaron B.
    My Woefully Neglected Blog, where I occasionally mention Perl.

Re^3: Checking for Files
by akrrs7 (Acolyte) on Nov 18, 2011 at 14:13 UTC
    Also - the values that I am getting for filesize and date modified do not match

      So what happens? Are you getting some other file's size/date or are the values completely bogus? That ctime function (where's that from anyway?) applied to mtime looks dubious. I assume use have left out a "use File::stat" too?