N
NSC
Hi all,
I have this :
<SNIP>
foreach $item (@NEW_FILES)
print "\n $item \n ";
($size,$atime,$mtime,$ctime) = (stat($item))[7..10];
$a_time = localtime($atime);
$m_time = localtime($mtime);
$c_time = localtime($ctime);
printf ("\n Size(bytes): %10d \n" ,
$size );
print " Creation Time : $c_time \n" ;
print " Last Modification : $m_time \n" ;
print " Last Access : $a_time \n";
print " Last Access : $a_time \n";
}
<SNIP>
and I like to do this:
<SNIP>
foreach $item (@NEW_FILES)
stats;
}
<SNIP>
so I made:
<SNIP>
sub stats
print "\n $item \n ";
($size,$atime,$mtime,$ctime) = (stat($item))[7..10];
$a_time = localtime($atime);
$m_time = localtime($mtime);
$c_time = localtime($ctime);
print "\n Size: $size \n";
print " Creation Time : $c_time \n" ;
print " Last Modification : $m_time \n" ;
print " Last Access : $a_time \n";
}
<SNIP>
and it didn't work !
I made the same with hash functions and it works.
I declared all variables with 'my' , is that the problem.
thanks all.
Simon S.
I have this :
<SNIP>
foreach $item (@NEW_FILES)
print "\n $item \n ";
($size,$atime,$mtime,$ctime) = (stat($item))[7..10];
$a_time = localtime($atime);
$m_time = localtime($mtime);
$c_time = localtime($ctime);
printf ("\n Size(bytes): %10d \n" ,
$size );
print " Creation Time : $c_time \n" ;
print " Last Modification : $m_time \n" ;
print " Last Access : $a_time \n";
print " Last Access : $a_time \n";
}
<SNIP>
and I like to do this:
<SNIP>
foreach $item (@NEW_FILES)
stats;
}
<SNIP>
so I made:
<SNIP>
sub stats
print "\n $item \n ";
($size,$atime,$mtime,$ctime) = (stat($item))[7..10];
$a_time = localtime($atime);
$m_time = localtime($mtime);
$c_time = localtime($ctime);
print "\n Size: $size \n";
print " Creation Time : $c_time \n" ;
print " Last Modification : $m_time \n" ;
print " Last Access : $a_time \n";
}
<SNIP>
and it didn't work !
I made the same with hash functions and it works.
I declared all variables with 'my' , is that the problem.
thanks all.
Simon S.