title: How do I use a block as an 'or' clause instead of a simple die?
body: <p>I want to check the results of an operation in the Net::FTP Perl module rather than die.</p>
  
  <p>Typically you would do:</p>
  
  <pre><code>$ftp-&gt;put($my_file)
    or die "Couldn't upload file";
  </code></pre>
  
  <p>But I want to do something else instead of just dying in this script so I tried:</p>
  
  <pre><code>$ftp-&gt;put($my_file)
    or {
        log("Couldn't upload $my_file");
        return(-1);
    }
  
  log("$my_file uploaded");
  </code></pre>
  
  <p>But Perl complains of compilation errors saying:</p>
  
  <pre><code>syntax error at toto.pl line nnn, near "log"
  </code></pre>
  
  <p>which is the second log in my code fragment.</p>
  
  <p>Any suggestions greatly appreciated.</p>
  
  <p>cheers,</p>