Hi all;
I have to control wheter a string is an array element or not.
I tried to exists function but it didn't give me the desired output.
print "Which hotel do you want to remove from the list?\n";
chomp($a = <STDIN>);
if(exists $name {$a}){
foreach $record(@name){
if($record eq $a)
{
delete $name[$j];
delete $rayt[$j];
delete $comf[$j];
delete $kitchen[$j];
delete $act[$j];
}
$j++;
}
}
else{
print "\nThe record couldn't find...\n";
}
When I try to remove a hotel name (which is already exist) from the array, it prints "The record couldn't find..."
Thanks for your helps....