Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Re^2: Sorting an array containing version numbers

by jffry (Hermit)
on Feb 22, 2012 at 21:13 UTC ( [id://955623] : note . print w/replies, xml ) Need Help??


in reply to Re: Sorting an array containing version numbers
in thread Sorting an array containing version numbers

To put those values in an array in sorted order using this technique, I had to do this:

for (sort (map {version->declare($_)} @unsorted_versions)) { push @versions, (sprintf "%s", $_); }

I also added () and {} to help my amateur mind see precedence and the for/sort/map boundaries easier.

Replies are listed 'Best First'.
Re^3: Sorting an array containing version numbers
by ikegami (Patriarch) on Feb 28, 2012 at 08:14 UTC
    You just had to change print "$_\n" for to @versions =.