CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Intermediate: Re: [FishMonger] Format Data: Edit Log



FishMonger
Veteran / Moderator

Oct 25, 2013, 6:52 AM


Views: 4605
Re: [FishMonger] Format Data

I had an "off by one" error.

chomp(my @lines = (<DATA>)[0..4,-4..-1]);

should be:
chomp(my @lines = (<DATA>)[0..4,-5..-1]);

And, to get the output order the way you wanted, you'll need to reverse the sort.

change:
foreach my $key (sort keys %HoA) {

to:
foreach my $key (reverse sort keys %HoA) {


(This post was edited by FishMonger on Oct 25, 2013, 6:54 AM)


Edit Log:
Post edited by FishMonger (Veteran) on Oct 25, 2013, 6:54 AM


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives