Advertisement

11.22.2007 at 08:58AM PST, ID: 22977840
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

8.4

Find the highest number bewteen 3 numbers in a string

Asked by rkckjk in Perl Programming Language

Tags: , , ,

I pulling in 3 numbers from a string example below in which I want to pick the highest number, sometimes there could be only 2 numbers and a blank or 1 number and two blanks or even maybe 3 blanks...then I want to return a blank:

307 525 295
110 205 110
269 347 278
129 209

Output:
525
205
347
209


I'm using this function to change time from am/pm to minutes:
sub ToMinutes {
   $_ = lc(shift);
   if (/(\d+):(\d{2})([ap])m/) {
      my ($hours,$mins,$ampm) = ($1, $2, $3);
      $hours %= 12;
      return $ampm eq 'a' ? ($mins + ($hours * 60)) :
           ($mins + (($hours + 12) * 60) - 1440 );
   }
   return " ";
}

I'm using this then to sort the three numbers:
print "$_" for (sort ToMinutes($TNC),ToMinutes($RISK),ToMinutes($CTMHM))[-1];

But I 'm getting the error:
Sort subroutine didn't return a numeric value

thanks
Start Free Trial
 
Keywords: Find the highest number bewteen 3 nu…
 
Loading Advertisement...
 
[+][-]11.22.2007 at 11:38AM PST, ID: 20335917

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]11.22.2007 at 11:42AM PST, ID: 20335930

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]11.22.2007 at 11:49AM PST, ID: 20335953

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]11.22.2007 at 11:55AM PST, ID: 20335972

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]11.22.2007 at 11:57AM PST, ID: 20335979

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]11.22.2007 at 11:58AM PST, ID: 20335985

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]11.22.2007 at 12:02PM PST, ID: 20336001

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]11.22.2007 at 12:06PM PST, ID: 20336014

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]11.22.2007 at 12:07PM PST, ID: 20336022

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]11.22.2007 at 12:09PM PST, ID: 20336030

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zone: Perl Programming Language
Tags: highest, find, number, string
Sign Up Now!
Solution Provided By: ozo
Participating Experts: 2
Solution Grade: A
 
 
[+][-]11.22.2007 at 12:11PM PST, ID: 20336041

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628