title: In Linux, how to change user to root in perl and continue to run this script? How to export proxy in perl?
body: <p>My perl scripts should be able to change the common account to root account during execution and then continue to the rest commands. But I don't know how to do:</p>
  
  <ol>
  <li><p>Change to root account and able to automatically pass authentication, I used following code, but failed.</p>
  
  <pre><code>system "echo \"$password\" | sudo -S su root";
  </code></pre></li>
  <li><p>Able to continue to do the rest scriptsI found when using scripts to change account (simply try system "sudo su";) , it is not able to execute rest scripts</p></li>
  <li><p>I need to export proxy, but when i using the following code, it does not work:</p>
  
  <pre><code>system "export http_proxy=http://proxy.companyname.com:8080"; 
  </code></pre></li>
  </ol>