Solved

better way to do this

Posted on 2001-06-10
2
116 Views
Last Modified: 2010-03-05
for($i=1; $i<25; $i++)
 {
  print "a";

  if($i/12==int($i/12))
   {
    print "b";
   };

  if($i/24==int($i/24))
   {
    print "c";
   };

  sleep 3600;
 };
0
Comment
Question by:superquestions
2 Comments
 
LVL 8

Expert Comment

by:bebonham
Comment Utility
try this:


for(1..125)
{
if($_%12==0)
{print "b";
print "\n$_\n";
if($_%24==0){
print "c";
print "\n$_\n";
}}
}



Bob


0
 
LVL 84

Accepted Solution

by:
ozo earned 75 total points
Comment Utility
$|=1;
for $i ( 1..24 ){
  print "a",$i%12?"":"b",!($i%24)&&"c";
  sleep 3600;
}
0

Featured Post

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Many time we need to work with multiple files all together. If its windows system then we can use some GUI based editor to accomplish our task. But what if you are on putty or have only CLI(Command Line Interface) as an option to  edit your files. I…
In the distant past (last year) I hacked together a little toy that would allow a couple of Manager types to query, preview, and extract data from a number of MongoDB instances, to their tool of choice: Excel (http://dilbert.com/strips/comic/2007-08…
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
This tutorial demonstrates a quick way of adding group price to multiple Magento products.

763 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

8 Experts available now in Live!

Get 1:1 Help Now