Hey I am trying to just write first simple perl script. Here what I am trying to do is pass the word which I want to find in array from command line. After that it should print all entries which contain that word. Say I want to find Jacob from command line but its not returning any result. Could u help me out
#! usr/bin/perl use Fcntl; print “content-type: text/html \n\n”; print “Enter word : “; $word = ; @myNames = (‘Jacob’, ‘Michael’, ‘Joshua’, ‘Matthew’, ‘Alexander’, ‘And +rew’); @grepNames = grep(/$word/, @myNames); foreach $Names(@grepNames) { print $Names; print “\n”; }
In reply to find words in array by sim
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |