Use a hash to cache your numbered values part and sort based on the keys.#!/usr/local/bin/perl -w use strict; my @stuff = qw (124.43.adsf.ca 235.23.aer.ca 100.34.asdm.ca); my %hash = map { $_, m{(\d+(?:\.\d+)*)} } @stuff; @stuff = sort {$hash{$a} <=> $hash{$b}} keys %hash; print join "\n", @stuff;
In reply to Re: Sorting @lines
by =sjs=
in thread Sorting @lines
by kanabrian
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |