Link to home
Start Free TrialLog in
Avatar of superquestions
superquestions

asked on

better way to do this

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;
 };
Avatar of bebonham
bebonham

try this:


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



Bob


ASKER CERTIFIED SOLUTION
Avatar of ozo
ozo
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial