avo has asked for the wisdom of the Perl Monks concerning the following question:
use lib "/wwwroot/myimap/"; use myimap; &myimap::myimap;
package myimap; our $our_cache_imap_object; sub helpdesk { if (ENTRY_POINT_FOR_CGI_ACTION...) { my $imap; if ( ! exists $our_cache_imap_object ) { # open the + imap connection using IMAP::Talk $imap = Ma +il::IMAPTalk->new( + Server => $server, + Port => $imap_port, + Username => $login, + Password => $password, + Separator => "\\", + RootFolder => '', + CaseInsensitive => 1, + Uid => 1) + || die "Connection failed. Reason: $@"; + + $our_cache_imap_object = $imap; + } elsif ($our_cach +e_imap_object->is_open()) { $imap = $our_c +ache_imap_object; } DEAL WITH THE IMAP OBJECT .... ETC. } } 1;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Mail::IMAPTalk and mod_perl
by kirillm (Friar) on Aug 18, 2008 at 22:56 UTC | |
by avo (Pilgrim) on Aug 19, 2008 at 08:06 UTC | |
|
Re: Mail::IMAPTalk and mod_perl
by jethro (Monsignor) on Aug 19, 2008 at 11:51 UTC |