title: How to install Perl packages automatically in FreeBSD using a Perl script without any prompt?
body: <p>I want to install Perl packages automatically using a Perl script. The code I am using is </p>
  
  <pre><code>#!/usr/bin/perl
  use strict;
  use warnings;
  use utf8;
  use CPAN;
  eval "use JSON" 
      or do {
      CPAN::install("JSON");
  };
  eval "use Net::Address::IP::Local" 
      or do { 
  
      CPAN::install("Net::Address::IP::Local");
  };
  eval "use Net::OpenSSH" 
      or do { 
  
      CPAN::install("Net::OpenSSH");
  };
  eval "use Net::SCP::Expect" 
      or do { 
  
      CPAN::install("Net::SCP::Expect");
  };
  </code></pre>
  
  <p>During the script runs, it asks for prompt like yes or no, passwords, etc. How to handle these prompt automatically? I have to deploy it on many servers so I had to automate it.</p>