anyavaiableidsleft
Technical User
Have HTML files that I want to (check for dupes) and put in date order. Each record begins with <H1> and ends with <HR>, so I would open the file and split @ <HR>. There's a date section in these records - mm-dd-yy - that would determine how the records are ordered.
$a =~ /(\d{2})\-(\d{2})\-(\d{2})/;
$c = $3 . $1 . $2;
would pull out the date and make it yymmdd, which would allow numeric comparison with other dates.
What I need, if possible, is how to load the file into an array, splitting at the <HR>, then pull out each record's date, compare it to the other records in the array, delete dupes, and then reorder (entire record) by most recent on top, and print back to the original file. I'd then
exec($file) to view it with my browser.
I'm not clear as to how to load the file and then go through the array with the sort function. I'm not a programmer and last used Perl a few years ago.
Thanks in advance
$a =~ /(\d{2})\-(\d{2})\-(\d{2})/;
$c = $3 . $1 . $2;
would pull out the date and make it yymmdd, which would allow numeric comparison with other dates.
What I need, if possible, is how to load the file into an array, splitting at the <HR>, then pull out each record's date, compare it to the other records in the array, delete dupes, and then reorder (entire record) by most recent on top, and print back to the original file. I'd then
exec($file) to view it with my browser.
I'm not clear as to how to load the file and then go through the array with the sort function. I'm not a programmer and last used Perl a few years ago.
Thanks in advance