E
emrefan
I have the follow script for printing out the Last Modification Time
of a file and it has been working on Solaris with Perl 5.6.1 and on
Redhat with Perl 5.8.0 without any problems.
fileLastModTm = localtime( (stat shift)[9] );
$fileLastModTm[4]++; # month no. was zero-based, change that
$fileLastModTm[5] += 1900; # year no. was 1900-based, change that
fileLastModTm[ 5, 4, 3 ]; # spit it out, in yyyymmdd format
But somebody who needed the script could not use it, getting an error
such as follows:
Can't modify constant item in scalar assignment at flmtime.pl line 1,
near ");"
Can't use subscript on constant item at flmtime.pl line 4, near "3 ]"
Execution of flmtime.pl aborted due to compilation errors.
So, what went wrong? Now, I am asking the person to give me her perl's
version, but meanwhile, I think you clever bunch can still spot the
error for me? Thanks.
of a file and it has been working on Solaris with Perl 5.6.1 and on
Redhat with Perl 5.8.0 without any problems.
fileLastModTm = localtime( (stat shift)[9] );
$fileLastModTm[4]++; # month no. was zero-based, change that
$fileLastModTm[5] += 1900; # year no. was 1900-based, change that
fileLastModTm[ 5, 4, 3 ]; # spit it out, in yyyymmdd format
But somebody who needed the script could not use it, getting an error
such as follows:
Can't modify constant item in scalar assignment at flmtime.pl line 1,
near ");"
Can't use subscript on constant item at flmtime.pl line 4, near "3 ]"
Execution of flmtime.pl aborted due to compilation errors.
So, what went wrong? Now, I am asking the person to give me her perl's
version, but meanwhile, I think you clever bunch can still spot the
error for me? Thanks.