|P is for Practical|
Re^5: very new to perl; suggestions for porting this shell script to perl?by Cristoforo (Deacon)
|on May 31, 2011 at 00:08 UTC||Need Help??|
I'm glad to hear it works OK. :-)
Do you know of any simple ways to make it respect the order in which they're specified when they're assigned at "my $regex ="?That occured to me after I posted the code, but I wasn't sure it was necessary.
Since your categories list is in alphabetical order, you could sort the keys in the print routine like:
for my $category (sort keys %data).
Glad to be of help!
Update: Just for the record, if the order of records was not in sort order, a few small changes would handle that situation.
At the top of the script, before the for loop, you would enter:
Then a small change to the print routine: