in reply to sort @array help

Given your 0 padding,just:  @sorted_array = sort @ip_addresses; seems to do what you want.