title: How to read the properties file from perl script
body: <p>I have written a perl script where I will be connecting to database, for which I'm using this statement  </p>
  
  <pre><code>my $dbh = DBI-&gt;connect(
      "DBI:mysql:database=test;host=localhost;mysql_socket=/var/run/mysqld/mysqld.sock",
      "root", "password", {'RaiseError' =&gt; 1});
  </code></pre>
  
  <p>As I don't  want any information to be hardcoded, I want to use properties file where I can list the above details (e.g.,  database, host, mysql_socket) and read the details of properties file from the script. How can I write the properties file and read the details from perl script?</p>