Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re^2: Checking for Files

by akrrs7 (Acolyte)
on Nov 18, 2011 at 14:04 UTC ( [id://938832]=note: print w/replies, xml ) Need Help??


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?

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://938832]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others pondering the Monastery: (5)
As of 2024-03-28 23:16 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found