title: Perl + LFTP Multiline Commands
body: <p>I was porting one of my existing scripts into perl and ran into some difficulty with executing system commands (specifically lftp). Here is how I did it in bash:</p>
  <h3>BASH:</h3>
  <pre><code>lftp -u $ftpusername,$ftppass -e open $hostname &lt;&lt; EOF
        set ftp:ssl-allow no
        set mirror:use-pget-n 5
        glob -a rm -r &quot;${remote_dir}/file.php&quot;
  EOF
  </code></pre>
  <p>So I'm wondering how I can execute this exact same command in Perl. Here's what I've tried with no avail:</p>
  <h3>Perl:</h3>
  <pre><code>system(&quot;lftp -u $ftpuser,$pass -e open $hostname
              set ftp:ssl-allow no
              set mirror:use-pget-n 5
              glob -a rm -r 'remote_dir/db-import.php'&quot;
        );
  </code></pre>
  <p>Any help would be appreciated, thank you!</p>