Perl sort numbers naturally
<p>I need to sort numbers and I am not able to get it to work the way I want. </p>

<p>Example input:</p>

<pre><code>15.12
16.1
15.2
15.1
</code></pre>

<p>Expected output:</p>

<pre><code>15.1
15.2
15.12
16.1
</code></pre>

<p>I tried normal sort and also <code>Sort::Naturally</code> for this. Neither works giving me the expected output.</p>

<p>I am also aware I can do something like the following to sort it the way I want.</p>

<pre><code>my @sorted =
map sprintf('%vd', $_),
sort
map join('', map chr, split /\./),
@data;
</code></pre>

<p>I am wondering if there are some pre existent modules that I can use though.</p>

<p>Thanks in advance.</p>