title: Issue with "#" in perl scripting
body: <p>I am developing an automation script in perl in which for authentication I have written a subroutine  which takes password input by user and return it to the main perl program which in turn passes the password to the tool that I need to automate.</p>
  
  <p>This script goes fine with every case unless the character <code>#</code> is part of the password. Then it is not able to automate the tool and fails for authentication.</p>
  
  <p>Below is the subroutine which I used for taking password input.</p>
  
  <pre><code>use Win32::Console;
  
  sub password() {
      $StdIn = new Win32::Console(STD_INPUT_HANDLE);
      my $Password = "";
  
      $StdIn-&gt;Mode(ENABLE_PROCESSED_INPUT);
      print "Enter Password: ";
  
      while (ord(my $Data = $StdIn-&gt;InputChar(1)) != 10) { 
          if("\r" eq $Data ) {
              last;
          }
          elsif ("\ch" eq $Data) {
              if( "" ne chop( $Password )) {
                  print "\ch \ch";
              }
              next;
          }
          $Password .=$Data;
          print "*";
      }
      return $Password;
  }
  </code></pre>
  
  <p>i am calling the above subroutine as   </p>
  
  <pre><code>$passwd = &amp;password();
  </code></pre>
  
  <p>And then passing the  <code>$passwd</code> to the tool that I need to automate as below,</p>
  
  <p>This is the line in which I pass the password to tool, </p>
  
  <pre><code>cc -c URL OF THE TOOL:$server -d $domain -t $appl -u $userid -p $passwd; \n"; 
  </code></pre>
  
  <p>Can anyone please cross check the code for calling the password() sub routine, returning $password and passing $passwd to the tool. I think error may be at one of the three places.Someone please help and if possible provide the code too.</p>