frkn5000 has asked for the wisdom of the Perl Monks concerning the following question:

This node falls below the community's threshold of quality. You may see it by logging in.

Replies are listed 'Best First'.
Re: sorting the numbers with strings
by choroba (Cardinal) on Oct 21, 2011 at 11:31 UTC
    Do you mean this?
    #!/usr/bin/perl use warnings; use strict; my $string = 'p(0)=0,35 p(1)=0,54 p(2)=0,12 p(3)=0,96 p(4)=0,43'; print join ' ', map { s/\./,/; $_ } sort { my ($x, $y) = map { s/,/./; /=(.*)/; $1 } $b, $a; $x <=> $y } split / /, $string; print "\n";
    You might also consider using Schwartzian Transform or Orcish Manœuvre.
Re: sorting the numbers with strings
by Anonymous Monk on Oct 21, 2011 at 10:05 UTC
Re: sorting the numbers with strings
by locked_user sundialsvc4 (Abbot) on Oct 21, 2011 at 12:38 UTC

    I would have said, “ask your teacher ...”

Re: sorting the numbers with strings
by rovf (Priest) on Oct 21, 2011 at 11:11 UTC
    What does string (p(0)) must know equal to the 0,35 mean, and what's exactly your question?

    -- 
    Ronald Fischer <ynnor@mm.st>