Thank you so much for taking the time to help me with this. Your code has worked perfectly.
If you'll pardon my one last question (I know, I know, I feel like I can't figure anything out on my own either…), my only experience so far with writing out to a file has been in the form of this:
open(Input, '+<…') || die "No such file found!"; open(Output, '>…') || die "Can't find the file!"; while(<Input>) { print Output $_; }
With your code, when I run it I receive a log file with all the data properly formatted. I simply cannot seem to find the right way to then print that out to my Output file.
If I change print $file; to return $file; I do not receive any output so I know it's stored somewhere.
There are a few more edits I need to make to the file before writing out as well. Would I write another subroutine, such as "handle_section" and place it within the primary subroutine?
In reply to Re^7: Use Perl's Sort to only sort certain lines in a file?
by grahambuck
in thread Use Perl's Sort to only sort certain lines in a file?
by grahambuck
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |