title: Inability to capture output from "dd" using backticks
body: <p>I've been working with a very old Solaris system and not in a position to add more modules to make my life easier, and I'm working with a number of scripts that use various command line options.</p>
  
  <p>The majority of what I'm working on is, in fact working, but I'm coming up with something that I just can't seem to get round.</p>
  
  <p>I'm pulling data from a tape using the "dd" command and need to capture the output to ascertain if I'm experiencing any tape read errors.</p>
  
  <p>("comment()" is a subroutine that I've already created)</p>
  
  <pre><code>#!/usr/local/bin/perl
  $| = 1;     #disable output buffering
  
  $tarfile = '/mnt/test/tmp/12345.tar';
  
  @tapeinfo = `dd if=/dev/rmt/1cbn of=$tarfile`;
  
  foreach(@tapeinfo){
  #Check to ensure that we're not getting read errors
   $result = index($_,'read: I/O error');
   if ($result &amp;lt; 0){
    #No read error, log result
    comment($_);
    } else {
    # read error, terminate
    comment("Terminating due to tape read error : $_");
    last; #exit loop if error is found
    }
  }
  #terminate with logging
  </code></pre>
  
  <p>When the script runs, I see "123+0 records in, 123+0 records out" being posted to the terminal screen, but my loop where the @tapeinfo doesn't seem to be testing against at all. I don't get either an error or a logging of the information.</p>
  
  <p>Am I missing something dreadfully simple here??</p>