shell programming and scripting

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.

#!/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";

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.

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: 

[/CODE]this loop dpes not end as the way it should have ended.

thanks
kullu

Oh yes it does.....

Are you sure you are testing the same script that you are editing?

Hi,

I think you are giving the input with some spaces.
There is nothing wrong with this script.
Just trace your program with print statement.

print "<$food>";

Cheers,
Ranga:)