in reply to While loop

You have to change a minor piece of your code, that is replace 'until' with 'while' ;-).

Just like so..
do { print "Enter Yes or No \n"; chomp($input = <>); if ($input eq 'yes') { print "Yes entered for system.\n"; } elsif($input eq 'no') { print "No entered for system.\n"; } } while ($input =~ /^yes$/ or $input =~ /^no$/);


$"=q;grep;;$,=q"grep";for(`find . -name ".saves*~"`){s;$/;;;/(.*-(\d+) +-.*)$/;$_=["ps -e -o pid | "," $2 | "," -v "," "];`@$_`?{print"+ $1"} +:{print"- $1"}&&`rm $1`;print"\n";}

Replies are listed 'Best First'.
Re: Re: While loop
by Mr. Muskrat (Canon) on May 14, 2002 at 19:22 UTC
    Shouldn't the
    while ($input =~ /^yes$/ or $input =~ /^no$/);
    actually be
    while ($input !~ /^yes$/ or $input !~ /^no$/);
    ?
    Who says that programmers can't work in the Marketing Department?
    Or is that who says that Marketing people can't program?
Re: Re: While loop
by Anonymous Monk on May 14, 2002 at 18:48 UTC
    Thanks for all answers.