You can use grep to achieve it like.$result = grep('w', @list);if there is a string 'w' in the list result will have 1 otherwise 0.
Does anyone knows of any function which gives me output as yes or no, whether an array or hash has certain text as value or key respectively.For example an array has elements (a, b, h, w, o, v, d) and i need to check whether the array contains 'w' as element or not?
A hash or an array ? A hash is easy, (if it is a key), as a value you can create a reverse hash and do it. Read the Perl FAQ for more details. For arrays, grep works (but is slower), the FAQ has a couple of other options, List::Util being a decent choice, faster but still easy to use.Andy
Hi AchinI think, exist function of HASH can solve your query.Hemant