Home > Back-end >  Need help sorting array in perl
Need help sorting array in perl

Time:09-17

using s perl script to parse an isc dhcp log, an merge it into a html table. so far so good, works as it should. in the script is an option to sort the results by ip adress. the result is not sorted by the last ip octet, so it will look like this:

192.168.250.149 192.168.250.2 192.168.250.228 and so on..

my skills in perl are very limited, so i need help to achieve this. this is the code part:

my @sorted = sort { ($data{$a}{'ip'}) cmp ($data{$b}{'ip'}) }            
  • Related