Breaking the program after answear

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • gtjj
    New Member
    • Oct 2012
    • 1

    Breaking the program after answear

    hello! i've started to study perl this year so im total new student in it and i would like to know how do i can break program if my resoult is "NO"

    here is my code

    Code:
    print "Enter any number to start counting: ";
    $a=0;
    $b=<STDIN>;
    $z;
    if($b>='10000'){
    print "ARE YOU FREAK?: ";
    $ans=<STDIN>;
    if($ans=='Yes' || $ans=='yes'){
    print "okay -_-";
    continue;
    }
    elsif($ans=='No' || $ans=='no'){
    print "God Blace!\n";
    exit;
    }
    }
    print "\nStart: 0";
    while($b<=>$z){
    print "~", $z=++$a;
    }
    print "\n\n\n";
    system'pause';
    thanks for attantion
    Last edited by Meetee; Oct 5 '12, 04:27 AM. Reason: Use code tags around your code
  • Rabbit
    Recognized Expert MVP
    • Jan 2007
    • 12517

    #2
    This thread has been closed because homework questions are not allowed on this forum.

    Comment

    Working...