#!/usr/bin/perl use strict; use warnings; my @data = ; { no warnings 'numeric'; print sort { $a <=> $b } @data; } __DATA__ 29.30.force.0.5.1LGY.pdb 30.31.force.0.5.1LGY.pdb 100.101.force.0.5.1LGY.pdb 9.10.force.0.5.1LGY.pdb 31.32.force.0.5.1LGY.pdb 200.201.force.0.5.1LGY.pdb 201.200.force.0.5.1LGY.pdb 101.102.force.0.5.1LGY.pdb