title: How to list outlook folders with Perl?
body: <p>I need help listing all folders in my Outlook inbox with Perl. I tried it using this code but cannot output prints nothing. I am such a beginner with Perl and I couldn't find any simple solution for this.</p>
  
  <pre><code>#!/usr/bin/perl
  use Win32::OLE qw(in with);
  use Win32::OLE::Const 'Microsoft Outlook';
  use Win32::OLE::Variant;
  
  my $OL = Win32::OLE-&gt;GetActiveObject('Outlook.Application');
  
  my $namespace = $OL-&gt;GetNamespace('MAPI');
  
  my $all_folders = $namespace-&gt;all_folders();
  
  print $all_folders;
  </code></pre>