title: Perl regex: How to find in a file a word typed by a user
body: <p>I am writing a script to read a LOG file. I want the user to type a word and then look it up and print the line (from a string) matching the word. </p>
  
  <p>I'm just learning Perl so please be very specific and simple so that I can understand it.</p>
  
  <pre><code> print "Please Enter the word to find: ";
   chomp ($userInput = &lt;STDIN&gt;);
  
   while ($line = &lt;INPUT&gt;)
   if ($line =~ /userInput/)
   print $line;
  </code></pre>
  
  <p>I know that this is not perfect but I'm just learning.  </p>