Advertisement

01.18.2005 at 09:13AM PST, ID: 21278902
[x]
Attachment Details

print to different files based on < or >  if statement

Asked by omcr in Perl Programming Language

I want to log alarms under 5min to a file, alarms 5 to 10 min old to another file,  and alarms older then 10 min to yet another.
Here is my attempt:


print FILE1 "Alarm occurred $diff minutes ago\n" if $diff <= 4.99;
print FILE2 "Alarm occurred $diff minutes ago\n" if ($diff >= 5.00) && ($diff <=9.99) ;
print FILE3 "Alarm occurred $diff minutes ago\n" if $diff >= 10.00;

I'm only getting the lessthen 4.99 data
 Start Free Trial
[+][-]01.18.2005 at 09:55AM PST, ID: 13074813

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.

 
[+][-]01.18.2005 at 09:57AM PST, ID: 13074832

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.

 
[+][-]01.18.2005 at 09:58AM PST, ID: 13074848

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.

 
[+][-]01.18.2005 at 09:59AM PST, ID: 13074860

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.

 
[+][-]01.18.2005 at 10:05AM PST, ID: 13074913

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
Sign Up Now!
Solution Provided By: bounsy
Participating Experts: 2
Solution Grade: A
 
 
[+][-]01.18.2005 at 11:16AM PST, ID: 13075604

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.

 
[+][-]01.18.2005 at 11:56AM PST, ID: 13075993

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.

 
[+][-]02.14.2005 at 10:30PM PST, ID: 13311244

Experts Exchange has a courteous staff of administrators who help members get the most out of the website by means of administrative comments like this one.

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

 
[+][-]02.19.2005 at 12:37AM PST, ID: 13352448

Experts Exchange has a courteous staff of administrators who help members get the most out of the website by means of administrative comments like this one.

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

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