AxKit2

 view release on metacpan or  search on metacpan

lib/AxKit2/XSP/SimpleTaglib.pm  view on Meta::CPAN

                $token = $realtoken;
                $$result{$token}{'param'} = { map { $_ => $i++ } ($params =~ m/\(([^ )]+)\)/g) };
            }
            if ($type eq '&') {
                ($$result{$token} = $$refs{$token})
                    || die("childStruct specification invalid. '&' reference not found.");
                die("childStruct specification invalid. '&' cannot be used on '*' nodes.")
                    if ($$result{$token}{'type'} eq '*');
                die("childStruct specification invalid. '&' may only take a reference.")
                    if $$result{'param'};
                eval { WeakRef::weaken($$result{$token}) };
                return $result if (!$next || $next eq '}');
                next;
            }
            $$result{$token}{'type'} = $type || '$';
            die("childStruct specification invalid. '${type}' cannot be used with '{'.")
                if ($next eq '{' and ($type eq '*' || $type eq '!'));
            die("childStruct specification invalid. '${type}' cannot be used with '(,,,)'.")
                if ($$result{$token}{'param'} and ($type eq '*' || $type eq '!'));
            die("childStruct specification invalid. '**' is not supported.")
                if ($token eq '*' and $type eq '*');

plugins/demo/webmail  view on Meta::CPAN

#!/usr/bin/perl -w

use Digest::SHA1 qw(sha1_hex);
use AxKit2::Utils qw(xml_escape);
use Net::IMAP::Simple::NB;
use Matts::Message::Parser;
use Scalar::Util qw(weaken isweak);
use Data::Pageset;
use Time::Piece qw(gmtime);
use Text::Wrap qw(wrap);
use File::Temp qw(tempfile);

my %imap_cache;
my %password_cache;

sub conf_IMAP_Server;
sub conf_IMAP_Port;

plugins/demo/webmail  view on Meta::CPAN

    # Get folders
    $imap->mailboxes(sub {
        my @boxes = @_;
        
        $output .= '<mailboxes>';
        
        my $start = "INBOX";
        
        my $sub;
        $sub = sub {
            weaken($sub) unless isweak($sub);
            
            my $num_msgs = shift;
            
            print "Got $start ($num_msgs)\n";
            
            $output .= '<mailbox><name>' . xml_escape($start) . '</name>' .
                                '<count>' . xml_escape($num_msgs) . '</count>' .
                       '</mailbox>';
            
            if (@boxes) {

plugins/demo/webmail  view on Meta::CPAN

        
        $output .= pageset_xml($pageset, $headers);
        
        my $current = $pageset->first;
        my $last    = $pageset->last;
        
        $output .= '<contents folder="' . xml_escape($folder) . '">';
        
        my $sub;
        $sub = sub {
            weaken($sub) unless isweak($sub);
            my $headers = shift;
            
            if ($headers) {
                my ($from)  = grep {/^From:/i} @$headers;
                my ($subj)  = grep {/^Subject:/i} @$headers;
                my ($recvd) = grep {/^Received:/i} @$headers;
                my ($date)  = grep {/^Date:/i} @$headers;
                s/^.*?:\s*// for ($from, $subj, $recvd, $date);
                local $/="\r\n";
                chomp($from, $subj);



( run in 1.182 second using v1.01-cache-2.11-cpan-65fba6d93b7 )