title: How can I read messages in a Gmail account from Perl?
body: <p>I have used the module <a href="http://search.cpan.org/dist/Mail-Webmail-Gmail" rel="noreferrer">Mail::Webmail::Gmail</a> to read the new messages in my Gmail account.</p>
  
  <p>I have written the following code for this purpose:</p>
  
  <pre><code>use strict;
  use warnings;
  use Data::Dumper;
  
  use Mail::Webmail::Gmail;
  
  my $gmail = Mail::Webmail::Gmail-&gt;new(
      username =&gt; 'username', password =&gt; 'password',
  );
  
  
  my $messages = $gmail-&gt;get_messages( label =&gt; $Mail::Webmail::Gmail::FOLDERS{ 'INBOX' } );
  
  
  foreach ( @{ $messages } ) {
      if ( $_-&gt;{ 'new' } ) {
          print "Subject: " . $_-&gt;{ 'subject' } . " / Blurb: " . $_-&gt;{ 'blurb' } . "\n";
      }
  }
  </code></pre>
  
  <p>But it didn't print anything.</p>
  
  <p>Can anyone help me in this or suggest any other module for this?</p>
  
  <p>Thanks in advance.</p>