I apologize in advance for still being such a newbie at Perl, but I need to write something so that a filehandle reads and prints an identified file, but it also prints the last_modified date for the file being read.
I'm just not sure how filehandles process the data, but I'm sure this is an easy thing to do.
Here's my example code in question (where the question marks = the part I can't figure out):
open( READ, "$file_to_print");
@array=<READ>;
close(READ);
print "File: $file_to_print\n\n";
print "Last updated:?";
foreach $line(@array){
print <<HTML;
$line
HTML
}
Can anyone help me out?
Many thanks.
($device_number, $inode_number, $file_mode, $number_of_links, $user_id, $group_id, $device_id, $file_size, $last_access, $last_modified, $inode_change_time, $block_size, $blocks) = stat($file_to_print); print "Last updated: $last_modified";