| 1 | package Email::MIME::RFC2047::Parser; | ||||||||||
| 2 | 4 | $Email::MIME::RFC2047::Parser::VERSION = '0.96'; | |||||||||
| 3 | 4 | ▶ | use strict; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 4 | 4 | ▶ | use warnings; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 5 | |||||||||||
| 6 | # ABSTRACT: Base class for parsers | ||||||||||
| 7 | |||||||||||
| 8 | sub _parse_error { | ||||||||||
| 9 | 9 | ▶ | my ($class, $string_ref, $what) = @_; | ||||||||
|
Subroutine
_parse_error: called CC=5 SCAR=16.2
| |||||||||||
| 10 | |||||||||||
| 11 | 9 | my $text; | |||||||||
| 12 | 9 | my $pos = pos($$string_ref); | |||||||||
| 13 | 9 | ▶ | $pos = 0 if !defined($pos); | ||||||||
|
Branch: 1 branch
| |||||||||||
| 14 | |||||||||||
| 15 | 9 | ▶ | if ($pos < length($$string_ref)) { | ||||||||
|
Branch: 1 branch
| |||||||||||
| 16 | 6 | my $char = substr($$string_ref, $pos, 1); | |||||||||
| 17 | 6 | ▶ | $text = defined($what) ? | ||||||||
|
Branch: 1 branch
| |||||||||||
| 18 | "invalid $what at character '$char', pos $pos in string" : | ||||||||||
| 19 | "unexpected character '$char' at pos $pos in string"; | ||||||||||
| 20 | } | ||||||||||
| 21 | else { | ||||||||||
| 22 | 3 | ▶ | $text = defined($what) ? | ||||||||
|
Branch: 1 branch
| |||||||||||
| 23 | "incomplete or missing $what at end of string" : | ||||||||||
| 24 | "unexpected end of string"; | ||||||||||
| 25 | } | ||||||||||
| 26 | |||||||||||
| 27 | 9 | die("Parse error in MIME header: $text $$string_ref\n"); | |||||||||
| 28 | } | ||||||||||
| 29 | |||||||||||
| 30 | 4 | 1; | |||||||||
| 31 | |||||||||||
| 32 | __END__ | ||||||||||