I posted some more code for you. Take a look and see "what is missing/not right".
Update: I see why you did: my $BckupKey="5-Duration"; Don't do this "5-" "decoration" of the hash key. There are better albeit advanced techniques for specifying the sort order. Concentrate on getting what data you need and then you can get help here about how to get it appear in the "right" order.
Below is just one example of a special sort order. A more robust thing would take into account what happens when I haven't specified the order of some input string vs another. I am just saying that advanced sorting is one of the things that Perl is very good at.
#!/usr/bin/perl -w use strict; my @special_order = ("x", "b", "a", "y"); my $i =0; my %sort_order = map{$_ => $i++}@special_order; my @array = ("a", "x", "y", "b"); @array = sort @array; print "Regular Sort: @array\n"; @array = ("a", "x", "y", "b"); @array = sort by_order @array; print "Special Sort: @array\n"; sub by_order { my $a_order = $sort_order{$a}; my $b_order = $sort_order{$b}; $a_order <=> $b_order } __END__ prints: Regular Sort: a b x y Special Sort: x b a y
In reply to Re^3: Parsing logs and bookmarking last line parsed
by Marshall
in thread Parsing logs and bookmarking last line parsed
by JaeDre619
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |