Perl Guru, please help

Archived from the original Sajha.com — preserved as posted, replies can no longer be added here.
Start a New Discussion
Archived Post

 How do I use a loop to find $query value in an array and display a message "present" if the value is present? for example, I have  @array= (1..10) I need to check if it has $query= "6" using loop. Thank you in advance!

Hydrogen Sulphide · Sep 16, 2013 3:28 AM · 10,541 views

1 Reply

foreach ( @array ) { print "present" if $_ == 6; }

dolphin · Sep 16, 2013 9:13 AM

This conversation is preserved exactly as it was on the original Sajha.com and can't accept new replies.

Start a New Discussion

You might be interested in...

Recent Classifieds View all
Upcoming Events View all
Service Providers View all