hi,
i am trying this while loop and i only want that it should only read food as pizza....no other entry should be taken here.
this is what the result i get after running this particular script, that the loop does not end and tht i have to terminate the session.
this loop dpes not end as the way it should have ended.
thanks
kullu
i am trying this while loop and i only want that it should only read food as pizza....no other entry should be taken here.
Code:
#!/usr/bin/perl -w
$food = " ";
while ( $food ne 'pizza' )
{
print 'enter what you had last night: ';
chomp ($food = <STDIN>);
#print $food ;
}
print "Mmm....it was yummy \n";
Code:
enter what you had last night: mango
enter what you had last night: pizza
enter what you had last night: tomato
enter what you had last night: potato
enter what you had last night:
thanks
kullu