Ing. Branislav Gerzo <[EMAIL PROTECTED]> wrote:

: I have:
: 
: my @array = ( '1/2/1',
:               '1/2/2',
:               '1/4/2',
:               '2/1/1',
:               '2/1/1',
:               '3/1/1' );

    What is it representative of? What is the application?
Will there be only didgits? What is the range of values
available.


: and now the task:
: I want to have in $out = '1/2/1', why ?
: 
: This is 3 (values to compare) of 3 (values in 1 field)
: statistics: 
: 
: Ok, first pick up _first_ number, do statistics (1 is winner),
: we get new array, next pick up _second_ number from @newarray
: (2 is winner), pick up third number and do statistics, if here
: is no winner, so return first value we have in list.
: 
: I think this is nice example for recursive function, do you
: agree ? 

    No. Probably not.

: 
: Ok, I am code that, so I am looking for your suggestions, too :)


   With the information presented:

my @stats = qw(
    1/2/1
    1/2/2
    1/4/2
    2/1/1
    2/1/1
    3/1/1
);

my @sorted_stats = sort @stats;

print $sorted_stats[0];

__END__

 
: (Also would be nice, if we have for example '1/2/2/3' values
: and do 3 values compare statistics, so it could be:
: 3 values to compare of 4 values in 1 field and similar counts,
: where always (values to compare) <= (values in 1 field)

    The example above would work. It pretty much depends on what
the range of values are in the fields. Tell us what those are
and we might be able to help more.


HTH,

Charles K. Clarkson
-- 
Mobile Homes Specialist
254 968-8328











-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to