title: Perl print device list
body: <p>I have one file which contain device name and it's an output from shell script depending upon region.So region is variable which can be change....e.g 
  devicelist=device.region </p>
  
  <p>Now I want to add this device list into email body. For sending email I am using perl script and I have tried below method but its not working...</p>
  
  <pre><code>my $file = "$ENV{devicelist}";
  open my $fh, '&lt;', $file;
  print while (&lt;$fh&gt;);
  
  I am getting this message as :  GLOB(0x11aeea8)
  </code></pre>
  
  <p>Perl script ....</p>
  
  <pre><code>my $file = "/tmp/devicelist";open my $fh, '&lt;', $file;print while (&lt;$fh&gt;);
  $logger-&gt;debug("$logid &gt;&gt; Device names is $deviceinfo");
  
  
           $smtp-&gt;datasend("Customer Name : $custname\n\n");
           $smtp-&gt;datasend("Site Location : $sitename\n\n");
           $smtp-&gt;datasend("Region : $region\n\n");
           my $file = "/tmp/devicelist";
           open my $fh, '&lt;', $file;
           print while (&lt;$fh&gt;);
           $smtp-&gt;datasend("Device Info : $deviceinfo\n\n"); 1st way
           $smtp-&gt;datasend("Device Info perl : $fh\n\n"); 2nd way
  </code></pre>
  
  <p>This request is dealing where i am sending email when there are more than 10 device down and I want to present those 10 devices names. Other information are showing perfectly fine as those are single value stored in variable like region,state ..etc...</p>
  
  <p>Thanks </p>