title: Perl read line string without trailing newline
body: <p>Very new to perl and have been stuck for quite awhile on this.</p>
  
  <p>If I change the variable from READSTDIN to google.com, it says google.com is online as it should. If I use the STDIN and input google.com and print $host it prints google.com, however in the ping it doesn't work.</p>
  
  <p>Sample output:</p>
  
  <pre><code>    perl perl.pl
  What is the website that is offline or displaying an error?google.com
  Warning: google.com
   appears to be down or icmp packets are blocked by their server
  </code></pre>
  
  <p>Code:</p>
  
  <pre><code>use strict;
  use warnings;
  use Net::Ping;
  
  #optionally specify a timeout in seconds (Defaults to 5 if not set)
  my $timeout = 10;
  
  # Create a new ping object
  my $p = Net::Ping-&gt;new("icmp");
  
  #Domain variable
  print "What is the website that is offline or displaying an error?";
  my $host = readline STDIN;
  
  # perform the ping
  if ( $p-&gt;ping( $host, $timeout ) ) {
      print "Host $host is alive\n";
  } else {
      print "Warning: $host appears to be down or icmp packets are blocked by their server\n";
  }
  
  # close our ping handle
  $p-&gt;close();
  </code></pre>
  
  <p>If I change the variable from READSTDIN to google.com, it says google.com is online as it should. If I use the STDIN and input google.com and print $host it prints google.com, however in the ping it doesn't work. I appreciate anyone who can help me at all!</p>