Perl: sort and get total
I have this script that prints a list of server names in STDOUT. I would like to sort that in alphabetical order and get the total number of servers.
Thanks. Code:
#!/usr/bin/env perl |
Quote:
Code:
perldoc -f sort You might want to put your server names into an array first. Read also Code:
perldoc -f scalar Code:
perldoc perlop |
I think you can use sort or reverse function:
Code:
@arr = ("Tango", "India", "Hotel", "Golf", "Alfa", "Zulu", "Romeo", "Foxtrot", "Juliet", "Beta", "Yenkey", "Kilo", "Papa", "November", "Lambda", "Whisky", "Mike", "Delta", "Quebec", "Sierra"); |
All times are GMT -5. The time now is 03:08 AM. |