Link to home
Start Free TrialLog in
Avatar of limva
limva

asked on

NEED HELP WITH GETTING FILE DATE

I'm trying to get the modified date of a file.  This is my test code:

<-- Start Code -->
#!/usr/bin/perl
use File::stat;
open(OUTFILE,">test.dat");
($dev,$ino,$mode,$nlink,$uid,$gid,$rdev,$size,
       $atime,$mtime,$ctime,$blksize,$blocks)
           = stat("test.dat");
print OUTFILE $mtime;
close(OUTFILE);
<-- End Code -->

Only $dev gives me some data, which is  "ARRAY(0x815596c)".  The rest of the variables give me nothing.

What am I doing wrong?

Avatar of NorCal2612
NorCal2612

what does this give you?:

#!/usr/bin/perl
use File::stat;
open(OUTFILE,">test.dat");
($dev,$ino,$mode,$nlink,$uid,$gid,$rdev,$size,
       $atime,$mtime,$ctime,$blksize,$blocks)
           = stat("test.dat");
print OUTFILE $dev[9];
close(OUTFILE);
ASKER CERTIFIED SOLUTION
Avatar of Tintin
Tintin

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of limva

ASKER

I removed "use File::stat;" and it worked!

Thanks guys!