in reply to Ignore this! Will repost later.
Your code as typed does not work, because $file is never initialized. And stat says
Returns a null list if the stat fails.
So you should first check that the file named in $file exists:
if (! -e $file) { die "Uhoh - '$file' does not exist."; };
and also, you should look at what you get in @file_info and $timestamp:
use Data::Dumper; print Dumper \@file_info;
Maybe you are running afoul of the meaning of backslashes in Perl and backslashes in Windows filenames? When specifying Windows filenames in Perl scripts, you need to double up every backslash:
my $file = "C:\\boot.ini"; print $file;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Trying to understand the warning.
by moritz (Cardinal) on Feb 01, 2009 at 21:58 UTC |