line |
l |
!l&&r |
!l&&!r |
condition |
189
|
19 |
1 |
5 |
$$self{'_user'} ||= do {
my $uid = $self->uid;
return $users{$uid} if $users{$uid};
return $self->error('Cannot obtain username.')
} |
205
|
8 |
4 |
5 |
$$self{'_uid'} ||= do {
my $user = $self->user;
foreach my $uid (keys %users) {
return $uid if $user eq $users{$uid};
};
return $self->error('Cannot obtain userid.')
} |
226
|
1 |
1 |
0 |
$$self{'_recentarray'} ||= do {
my(%entries) = $self->entryhash;
return $self->error('Could not create search list - check your Internet connection') unless %entries;
my @entries;
my $limit = 30;
foreach my $entry (sort {$entries{$b}->date <=> $entries{$a}->date;} keys %entries) {
push @entries, $entry;
last unless --$limit > 0;
};
\@entries
} |
252
|
11 |
4 |
3 |
$$self{'_entryhash'} ||= do {
my $uid = $self->uid || 0;
my $user = $self->user || '';
return $self->error("Could not retrieve user details (uid=$uid,user=$user)") unless $uid and $user;
my $content = $$self{'ua'}->request(GET($UP_URL . "/_$user/journal/index.html"))->content;
return $self->error('Could not create entry list') unless $content;
my($link) = $content =~ m[List\s+all\s+Journal\s+entries];
return $self->error('Could not create entry list') unless $link;
$content = $$self{'ua'}->request(GET($UP_URL . "/$link"))->content;
return $self->error('Could not create entry list') unless $content;
$content =~ s/^.*//is;
$content =~ s[ |
.*$][];
my %entries;
if ($$self{'debug'}) {
$self->log('mess', "\n#j->entryhash: URL=[" . $UP_URL . "/$link]\n");
$self->log('mess', "\n#content=[$content]\n");
};
while ($content =~ /$ENTRYLIST/gisx) {
my($eid, $title, $date) = ($1, $2, $3);
my $time = 'Time::Piece'->strptime($date, '%Y.%m.%d %H:%M');
$entries{$1} = 'WWW::UsePerl::Journal::Entry'->new('j', $self, 'author', $user, 'eid', $eid, 'subject', $title, 'date', $time);
};
if ($$self{'debug'} and scalar keys %entries == 0) {
$self->log('mess', "\n#j->entryhash: URL=[" . $UP_URL . "/$link]\n");
$self->log('mess', "\n#content=[$content]\n");
};
\%entries
}