File Coverage

blib/lib/HTML/HeadParser.pm
Criterion Covered Total %
statement 80 84 95.2
branch 48 58 82.7
condition 9 14 64.2
subroutine 10 10 100.0
pod 5 7 71.4
total 152 173 87.8


line stmt bran cond sub pod time code
1             package HTML::HeadParser;
2              
3             =head1 NAME
4              
5             HTML::HeadParser - Parse section of a HTML document
6              
7             =head1 SYNOPSIS
8              
9             require HTML::HeadParser;
10             $p = HTML::HeadParser->new;
11             $p->parse($text) and print "not finished";
12              
13             $p->header('Title') # to access ....
14             $p->header('Content-Base') # to access
15             $p->header('Foo') # to access
16             $p->header('X-Meta-Author') # to access
17             $p->header('X-Meta-Charset') # to access
18              
19             =head1 DESCRIPTION
20              
21             The C is a specialized (and lightweight)
22             C that will only parse the EHEAD>...E/HEAD>
23             section of an HTML document. The parse() method
24             will return a FALSE value as soon as some EBODY> element or body
25             text are found, and should not be called again after this.
26              
27             Note that the C might get confused if raw undecoded
28             UTF-8 is passed to the parse() method. Make sure the strings are
29             properly decoded before passing them on.
30              
31             The C keeps a reference to a header object, and the
32             parser will update this header object as the various elements of the
33             EHEAD> section of the HTML document are recognized. The following
34             header fields are affected:
35              
36             =over 4
37              
38             =item Content-Base:
39              
40             The I header is initialized from the Ebase
41             href="..."> element.
42              
43             =item Title:
44              
45             The I header is initialized from the E<lt>title>...E<lt>/title> </td> </tr> <tr> <td class="h" > <a name="46">46</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> element. </td> </tr> <tr> <td class="h" > <a name="47">47</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="48">48</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> =item Isindex: </td> </tr> <tr> <td class="h" > <a name="49">49</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="50">50</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> The I<Isindex> header will be added if there is a E<lt>isindex> </td> </tr> <tr> <td class="h" > <a name="51">51</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> element in the E<lt>head>. The header value is initialized from the </td> </tr> <tr> <td class="h" > <a name="52">52</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> I<prompt> attribute if it is present. If no I<prompt> attribute is </td> </tr> <tr> <td class="h" > <a name="53">53</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> given it will have '?' as the value. </td> </tr> <tr> <td class="h" > <a name="54">54</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="55">55</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> =item X-Meta-Foo: </td> </tr> <tr> <td class="h" > <a name="56">56</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="57">57</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> All E<lt>meta> elements containing a C<name> attribute will result in </td> </tr> <tr> <td class="h" > <a name="58">58</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> headers using the prefix C<X-Meta-> appended with the value of the </td> </tr> <tr> <td class="h" > <a name="59">59</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> C<name> attribute as the name of the header, and the value of the </td> </tr> <tr> <td class="h" > <a name="60">60</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> C<content> attribute as the pushed header value. </td> </tr> <tr> <td class="h" > <a name="61">61</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="62">62</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> E<lt>meta> elements containing a C<http-equiv> attribute will result </td> </tr> <tr> <td class="h" > <a name="63">63</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> in headers as in above, but without the C<X-Meta-> prefix in the </td> </tr> <tr> <td class="h" > <a name="64">64</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> header name. </td> </tr> <tr> <td class="h" > <a name="65">65</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="66">66</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> E<lt>meta> elements containing a C<charset> attribute will result in </td> </tr> <tr> <td class="h" > <a name="67">67</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> an C<X-Meta-Charset> header, using the value of the C<charset> </td> </tr> <tr> <td class="h" > <a name="68">68</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> attribute as the pushed header value. </td> </tr> <tr> <td class="h" > <a name="69">69</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="70">70</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> The ':' character can't be represented in header field names, so </td> </tr> <tr> <td class="h" > <a name="71">71</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> if the meta element contains this char it's substituted with '-' </td> </tr> <tr> <td class="h" > <a name="72">72</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> before forming the field name. </td> </tr> <tr> <td class="h" > <a name="73">73</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="74">74</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> =back </td> </tr> <tr> <td class="h" > <a name="75">75</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="76">76</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> =head1 METHODS </td> </tr> <tr> <td class="h" > <a name="77">77</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="78">78</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> The following methods (in addition to those provided by the </td> </tr> <tr> <td class="h" > <a name="79">79</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> superclass) are available: </td> </tr> <tr> <td class="h" > <a name="80">80</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="81">81</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> =over 4 </td> </tr> <tr> <td class="h" > <a name="82">82</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="83">83</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> =cut </td> </tr> <tr> <td class="h" > <a name="84">84</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="85">85</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="86">86</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> require HTML::Parser; </td> </tr> <tr> <td class="h" > <a name="87">87</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> our @ISA = qw(HTML::Parser); </td> </tr> <tr> <td class="h" > <a name="88">88</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="89">89</a> </td> <td class="c3" > 2 </td> <td >   </td> <td >   </td> <td class="c3" > <a href="blib-lib-HTML-HeadParser-pm--subroutine.html#89-1"> 2 </a> </td> <td >   </td> <td > 2422 </td> <td class="s"> use HTML::Entities (); </td> </tr> <tr> <td class="h" > <a > </a> </td> <td class="c3" > 2 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td > 9 </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a > </a> </td> <td class="c3" > 2 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td > 69 </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="90">90</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="91">91</a> </td> <td class="c3" > 2 </td> <td >   </td> <td >   </td> <td class="c3" > <a href="blib-lib-HTML-HeadParser-pm--subroutine.html#91-1"> 2 </a> </td> <td >   </td> <td > 15 </td> <td class="s"> use strict; </td> </tr> <tr> <td class="h" > <a > </a> </td> <td class="c3" > 2 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td > 3 </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a > </a> </td> <td class="c3" > 2 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td > 2684 </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="92">92</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> our $DEBUG; </td> </tr> <tr> <td class="h" > <a name="93">93</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> #$DEBUG = 1; </td> </tr> <tr> <td class="h" > <a name="94">94</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> our $VERSION = '3.80'; </td> </tr> <tr> <td class="h" > <a name="95">95</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="96">96</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> =item $hp = HTML::HeadParser->new </td> </tr> <tr> <td class="h" > <a name="97">97</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="98">98</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> =item $hp = HTML::HeadParser->new( $header ) </td> </tr> <tr> <td class="h" > <a name="99">99</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="100">100</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> The object constructor. The optional $header argument should be a </td> </tr> <tr> <td class="h" > <a name="101">101</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> reference to an object that implement the header() and push_header() </td> </tr> <tr> <td class="h" > <a name="102">102</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> methods as defined by the C<HTTP::Headers> class. Normally it will be </td> </tr> <tr> <td class="h" > <a name="103">103</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> of some class that is a or delegates to the C<HTTP::Headers> class. </td> </tr> <tr> <td class="h" > <a name="104">104</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="105">105</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> If no $header is given C<HTML::HeadParser> will create an </td> </tr> <tr> <td class="h" > <a name="106">106</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> C<HTTP::Headers> object by itself (initially empty). </td> </tr> <tr> <td class="h" > <a name="107">107</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="108">108</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> =cut </td> </tr> <tr> <td class="h" > <a name="109">109</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="110">110</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> sub new </td> </tr> <tr> <td class="h" > <a name="111">111</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> { </td> </tr> <tr> <td class="h" > <a name="112">112</a> </td> <td class="c3" > 8 </td> <td >   </td> <td >   </td> <td class="c3" > <a href="blib-lib-HTML-HeadParser-pm--subroutine.html#112-1"> 8 </a> </td> <td class="c3" > <a href="blib-lib-HTML-HeadParser-pm--subroutine.html#112-1"> 1 </a> </td> <td > 3950 </td> <td class="s"> my($class, $header) = @_; </td> </tr> <tr> <td class="h" > <a name="113">113</a> </td> <td class="c3" > 8 </td> <td class="c3" > <a href="blib-lib-HTML-HeadParser-pm--branch.html#113-1"> 100 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td > 30 </td> <td class="s"> unless ($header) { </td> </tr> <tr> <td class="h" > <a name="114">114</a> </td> <td class="c3" > 1 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td > 492 </td> <td class="s"> require HTTP::Headers; </td> </tr> <tr> <td class="h" > <a name="115">115</a> </td> <td class="c3" > 1 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td > 6671 </td> <td class="s"> $header = HTTP::Headers->new; </td> </tr> <tr> <td class="h" > <a name="116">116</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="117">117</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="118">118</a> </td> <td class="c3" > 8 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td > 72 </td> <td class="s"> my $self = $class->SUPER::new(api_version => 3, </td> </tr> <tr> <td class="h" > <a name="119">119</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> start_h => ["start", "self,tagname,attr"], </td> </tr> <tr> <td class="h" > <a name="120">120</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> end_h => ["end", "self,tagname"], </td> </tr> <tr> <td class="h" > <a name="121">121</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> text_h => ["text", "self,text"], </td> </tr> <tr> <td class="h" > <a name="122">122</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> ignore_elements => [qw(script style)], </td> </tr> <tr> <td class="h" > <a name="123">123</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> ); </td> </tr> <tr> <td class="h" > <a name="124">124</a> </td> <td class="c3" > 8 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td > 36 </td> <td class="s"> $self->{'header'} = $header; </td> </tr> <tr> <td class="h" > <a name="125">125</a> </td> <td class="c3" > 8 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td > 16 </td> <td class="s"> $self->{'tag'} = ''; # name of active element that takes textual content </td> </tr> <tr> <td class="h" > <a name="126">126</a> </td> <td class="c3" > 8 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td > 15 </td> <td class="s"> $self->{'text'} = ''; # the accumulated text associated with the element </td> </tr> <tr> <td class="h" > <a name="127">127</a> </td> <td class="c3" > 8 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td > 57 </td> <td class="s"> $self; </td> </tr> <tr> <td class="h" > <a name="128">128</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="129">129</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="130">130</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> =item $hp->header; </td> </tr> <tr> <td class="h" > <a name="131">131</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="132">132</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> Returns a reference to the header object. </td> </tr> <tr> <td class="h" > <a name="133">133</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="134">134</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> =item $hp->header( $key ) </td> </tr> <tr> <td class="h" > <a name="135">135</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="136">136</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> Returns a header value. It is just a shorter way to write </td> </tr> <tr> <td class="h" > <a name="137">137</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> C<$hp-E<gt>header-E<gt>header($key)>. </td> </tr> <tr> <td class="h" > <a name="138">138</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="139">139</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> =cut </td> </tr> <tr> <td class="h" > <a name="140">140</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="141">141</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> sub header </td> </tr> <tr> <td class="h" > <a name="142">142</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> { </td> </tr> <tr> <td class="h" > <a name="143">143</a> </td> <td class="c3" > 14 </td> <td >   </td> <td >   </td> <td class="c3" > <a href="blib-lib-HTML-HeadParser-pm--subroutine.html#143-1"> 14 </a> </td> <td class="c3" > <a href="blib-lib-HTML-HeadParser-pm--subroutine.html#143-1"> 1 </a> </td> <td > 6321 </td> <td class="s"> my $self = shift; </td> </tr> <tr> <td class="h" > <a name="144">144</a> </td> <td class="c3" > 14 </td> <td class="c3" > <a href="blib-lib-HTML-HeadParser-pm--branch.html#144-1"> 100 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td > 49 </td> <td class="s"> return $self->{'header'} unless @_; </td> </tr> <tr> <td class="h" > <a name="145">145</a> </td> <td class="c3" > 13 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td > 37 </td> <td class="s"> $self->{'header'}->header(@_); </td> </tr> <tr> <td class="h" > <a name="146">146</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="147">147</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="148">148</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> sub as_string # legacy </td> </tr> <tr> <td class="h" > <a name="149">149</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> { </td> </tr> <tr> <td class="h" > <a name="150">150</a> </td> <td class="c3" > 3 </td> <td >   </td> <td >   </td> <td class="c3" > <a href="blib-lib-HTML-HeadParser-pm--subroutine.html#150-1"> 3 </a> </td> <td class="c0" > <a href="blib-lib-HTML-HeadParser-pm--subroutine.html#150-1"> 0 </a> </td> <td > 461 </td> <td class="s"> my $self = shift; </td> </tr> <tr> <td class="h" > <a name="151">151</a> </td> <td class="c3" > 3 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td > 10 </td> <td class="s"> $self->{'header'}->as_string; </td> </tr> <tr> <td class="h" > <a name="152">152</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="153">153</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="154">154</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> sub flush_text # internal </td> </tr> <tr> <td class="h" > <a name="155">155</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> { </td> </tr> <tr> <td class="h" > <a name="156">156</a> </td> <td class="c3" > 13 </td> <td >   </td> <td >   </td> <td class="c3" > <a href="blib-lib-HTML-HeadParser-pm--subroutine.html#156-1"> 13 </a> </td> <td class="c0" > <a href="blib-lib-HTML-HeadParser-pm--subroutine.html#156-1"> 0 </a> </td> <td > 25 </td> <td class="s"> my $self = shift; </td> </tr> <tr> <td class="h" > <a name="157">157</a> </td> <td class="c3" > 13 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td > 17 </td> <td class="s"> my $tag = $self->{'tag'}; </td> </tr> <tr> <td class="h" > <a name="158">158</a> </td> <td class="c3" > 13 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td > 23 </td> <td class="s"> my $text = $self->{'text'}; </td> </tr> <tr> <td class="h" > <a name="159">159</a> </td> <td class="c3" > 13 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td > 30 </td> <td class="s"> $text =~ s/^\s+//; </td> </tr> <tr> <td class="h" > <a name="160">160</a> </td> <td class="c3" > 13 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td > 38 </td> <td class="s"> $text =~ s/\s+$//; </td> </tr> <tr> <td class="h" > <a name="161">161</a> </td> <td class="c3" > 13 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td > 46 </td> <td class="s"> $text =~ s/\s+/ /g; </td> </tr> <tr> <td class="h" > <a name="162">162</a> </td> <td class="c3" > 13 </td> <td class="c0" > <a href="blib-lib-HTML-HeadParser-pm--branch.html#162-1"> 50 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td > 30 </td> <td class="s"> print "FLUSH $tag => '$text'\n" if $DEBUG; </td> </tr> <tr> <td class="h" > <a name="163">163</a> </td> <td class="c3" > 13 </td> <td class="c3" > <a href="blib-lib-HTML-HeadParser-pm--branch.html#163-1"> 100 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td > 30 </td> <td class="s"> if ($tag eq 'title') { </td> </tr> <tr> <td class="h" > <a name="164">164</a> </td> <td class="c3" > 7 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td > 12 </td> <td class="s"> my $decoded; </td> </tr> <tr> <td class="h" > <a name="165">165</a> </td> <td class="c3" > 7 </td> <td class="c3" > <a href="blib-lib-HTML-HeadParser-pm--branch.html#165-1"> 100 </a> </td> <td class="c0" > <a href="blib-lib-HTML-HeadParser-pm--condition.html#165-1"> 66 </a> </td> <td >   </td> <td >   </td> <td > 37 </td> <td class="s"> $decoded = utf8::decode($text) if $self->utf8_mode && defined &utf8::decode; </td> </tr> <tr> <td class="h" > <a name="166">166</a> </td> <td class="c3" > 7 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td > 39 </td> <td class="s"> HTML::Entities::decode($text); </td> </tr> <tr> <td class="h" > <a name="167">167</a> </td> <td class="c3" > 7 </td> <td class="c3" > <a href="blib-lib-HTML-HeadParser-pm--branch.html#167-1"> 100 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td > 23 </td> <td class="s"> utf8::encode($text) if $decoded; </td> </tr> <tr> <td class="h" > <a name="168">168</a> </td> <td class="c3" > 7 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td > 27 </td> <td class="s"> $self->{'header'}->push_header(Title => $text); </td> </tr> <tr> <td class="h" > <a name="169">169</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="170">170</a> </td> <td class="c3" > 13 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td > 128 </td> <td class="s"> $self->{'tag'} = $self->{'text'} = ''; </td> </tr> <tr> <td class="h" > <a name="171">171</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="172">172</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="173">173</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # This is an quote from the HTML3.2 DTD which shows which elements </td> </tr> <tr> <td class="h" > <a name="174">174</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # that might be present in a <HEAD>...</HEAD>. Also note that the </td> </tr> <tr> <td class="h" > <a name="175">175</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # <HEAD> tags themselves might be missing: </td> </tr> <tr> <td class="h" > <a name="176">176</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # </td> </tr> <tr> <td class="h" > <a name="177">177</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # <!ENTITY % head.content "TITLE & ISINDEX? & BASE? & STYLE? & </td> </tr> <tr> <td class="h" > <a name="178">178</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # SCRIPT* & META* & LINK*"> </td> </tr> <tr> <td class="h" > <a name="179">179</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # </td> </tr> <tr> <td class="h" > <a name="180">180</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # <!ELEMENT HEAD O O (%head.content)> </td> </tr> <tr> <td class="h" > <a name="181">181</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # </td> </tr> <tr> <td class="h" > <a name="182">182</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # From HTML 4.01: </td> </tr> <tr> <td class="h" > <a name="183">183</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # </td> </tr> <tr> <td class="h" > <a name="184">184</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # <!ENTITY % head.misc "SCRIPT|STYLE|META|LINK|OBJECT"> </td> </tr> <tr> <td class="h" > <a name="185">185</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # <!ENTITY % head.content "TITLE & BASE?"> </td> </tr> <tr> <td class="h" > <a name="186">186</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # <!ELEMENT HEAD O O (%head.content;) +(%head.misc;)> </td> </tr> <tr> <td class="h" > <a name="187">187</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # </td> </tr> <tr> <td class="h" > <a name="188">188</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # From HTML 5 as of WD-html5-20090825: </td> </tr> <tr> <td class="h" > <a name="189">189</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # </td> </tr> <tr> <td class="h" > <a name="190">190</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # One or more elements of metadata content, [...] </td> </tr> <tr> <td class="h" > <a name="191">191</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # => base, command, link, meta, noscript, script, style, title </td> </tr> <tr> <td class="h" > <a name="192">192</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="193">193</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> sub start </td> </tr> <tr> <td class="h" > <a name="194">194</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> { </td> </tr> <tr> <td class="h" > <a name="195">195</a> </td> <td class="c3" > 47 </td> <td >   </td> <td >   </td> <td class="c3" > <a href="blib-lib-HTML-HeadParser-pm--subroutine.html#195-1"> 47 </a> </td> <td class="c3" > <a href="blib-lib-HTML-HeadParser-pm--subroutine.html#195-1"> 1 </a> </td> <td > 1468 </td> <td class="s"> my($self, $tag, $attr) = @_; # $attr is reference to a HASH </td> </tr> <tr> <td class="h" > <a name="196">196</a> </td> <td class="c3" > 47 </td> <td class="c0" > <a href="blib-lib-HTML-HeadParser-pm--branch.html#196-1"> 50 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td > 84 </td> <td class="s"> print "START[$tag]\n" if $DEBUG; </td> </tr> <tr> <td class="h" > <a name="197">197</a> </td> <td class="c3" > 47 </td> <td class="c3" > <a href="blib-lib-HTML-HeadParser-pm--branch.html#197-1"> 100 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td > 91 </td> <td class="s"> $self->flush_text if $self->{'tag'}; </td> </tr> <tr> <td class="h" > <a name="198">198</a> </td> <td class="c3" > 47 </td> <td class="c3" > <a href="blib-lib-HTML-HeadParser-pm--branch.html#198-1"> 100 </a> </td> <td class="c0" > <a href="blib-lib-HTML-HeadParser-pm--condition.html#198-1"> 66 </a> </td> <td >   </td> <td >   </td> <td > 245 </td> <td class="s"> if ($tag eq 'meta') { </td> </tr> <tr> <td class="h" > <a > </a> </td> <td >   </td> <td class="c3" > <a href="blib-lib-HTML-HeadParser-pm--branch.html#-2"> 100 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a > </a> </td> <td >   </td> <td class="c0" > <a href="blib-lib-HTML-HeadParser-pm--branch.html#-3"> 50 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a > </a> </td> <td >   </td> <td class="c3" > <a href="blib-lib-HTML-HeadParser-pm--branch.html#-4"> 100 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a > </a> </td> <td >   </td> <td class="c3" > <a href="blib-lib-HTML-HeadParser-pm--branch.html#-5"> 100 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a > </a> </td> <td >   </td> <td class="c0" > <a href="blib-lib-HTML-HeadParser-pm--branch.html#-6"> 50 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="199">199</a> </td> <td class="c3" > 20 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td > 35 </td> <td class="s"> my $key = $attr->{'http-equiv'}; </td> </tr> <tr> <td class="h" > <a name="200">200</a> </td> <td class="c3" > 20 </td> <td class="c3" > <a href="blib-lib-HTML-HeadParser-pm--branch.html#200-1"> 100 </a> </td> <td class="c0" > <a href="blib-lib-HTML-HeadParser-pm--condition.html#200-1"> 66 </a> </td> <td >   </td> <td >   </td> <td > 56 </td> <td class="s"> if (!defined($key) || !length($key)) { </td> </tr> <tr> <td class="h" > <a name="201">201</a> </td> <td class="c3" > 13 </td> <td class="c3" > <a href="blib-lib-HTML-HeadParser-pm--branch.html#201-1"> 100 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td > 28 </td> <td class="s"> if ($attr->{name}) { </td> </tr> <tr> <td class="h" > <a > </a> </td> <td >   </td> <td class="c0" > <a href="blib-lib-HTML-HeadParser-pm--branch.html#-2"> 50 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="202">202</a> </td> <td class="c3" > 10 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td > 26 </td> <td class="s"> $key = "X-Meta-\u$attr->{name}"; </td> </tr> <tr> <td class="h" > <a name="203">203</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } elsif ($attr->{charset}) { # HTML 5 <meta charset="..."> </td> </tr> <tr> <td class="h" > <a name="204">204</a> </td> <td class="c3" > 3 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td > 7 </td> <td class="s"> $key = "X-Meta-Charset"; </td> </tr> <tr> <td class="h" > <a name="205">205</a> </td> <td class="c3" > 3 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td > 7 </td> <td class="s"> $self->{header}->push_header($key => $attr->{charset}); </td> </tr> <tr> <td class="h" > <a name="206">206</a> </td> <td class="c3" > 3 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td > 109 </td> <td class="s"> return; </td> </tr> <tr> <td class="h" > <a name="207">207</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } else { </td> </tr> <tr> <td class="h" > <a name="208">208</a> </td> <td class="c0" > <a href="#220"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td > 0 </td> <td class="s"> return; </td> </tr> <tr> <td class="h" > <a name="209">209</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="210">210</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="211">211</a> </td> <td class="c3" > 17 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td > 41 </td> <td class="s"> $key =~ s/:/-/g; </td> </tr> <tr> <td class="h" > <a name="212">212</a> </td> <td class="c3" > 17 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td > 45 </td> <td class="s"> $self->{'header'}->push_header($key => $attr->{content}); </td> </tr> <tr> <td class="h" > <a name="213">213</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } elsif ($tag eq 'base') { </td> </tr> <tr> <td class="h" > <a name="214">214</a> </td> <td class="c3" > 4 </td> <td class="c0" > <a href="blib-lib-HTML-HeadParser-pm--branch.html#214-1"> 50 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td > 13 </td> <td class="s"> return unless exists $attr->{href}; </td> </tr> <tr> <td class="h" > <a name="215">215</a> </td> <td class="c3" > 4 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td > 14 </td> <td class="s"> (my $base = $attr->{href}) =~ s/^\s+//; $base =~ s/\s+$//; # HTML5 </td> </tr> <tr> <td class="h" > <a > </a> </td> <td class="c3" > 4 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td > 12 </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="216">216</a> </td> <td class="c3" > 4 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td > 16 </td> <td class="s"> $self->{'header'}->push_header('Content-Base' => $base); </td> </tr> <tr> <td class="h" > <a name="217">217</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } elsif ($tag eq 'isindex') { </td> </tr> <tr> <td class="h" > <a name="218">218</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # This is a non-standard header. Perhaps we should just ignore </td> </tr> <tr> <td class="h" > <a name="219">219</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # this element </td> </tr> <tr> <td class="h" > <a name="220">220</a> </td> <td class="c0" > <a href="#239"> 0 </a> </td> <td >   </td> <td class="c0" > <a href="blib-lib-HTML-HeadParser-pm--condition.html#220-1"> 0 </a> </td> <td >   </td> <td >   </td> <td > 0 </td> <td class="s"> $self->{'header'}->push_header(Isindex => $attr->{prompt} || '?'); </td> </tr> <tr> <td class="h" > <a name="221">221</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } elsif ($tag =~ /^(?:title|noscript|object|command)$/) { </td> </tr> <tr> <td class="h" > <a name="222">222</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # Just remember tag. Initialize header when we see the end tag. </td> </tr> <tr> <td class="h" > <a name="223">223</a> </td> <td class="c3" > 13 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td > 76 </td> <td class="s"> $self->{'tag'} = $tag; </td> </tr> <tr> <td class="h" > <a name="224">224</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } elsif ($tag eq 'link') { </td> </tr> <tr> <td class="h" > <a name="225">225</a> </td> <td class="c3" > 6 </td> <td class="c0" > <a href="blib-lib-HTML-HeadParser-pm--branch.html#225-1"> 50 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td > 22 </td> <td class="s"> return unless exists $attr->{href}; </td> </tr> <tr> <td class="h" > <a name="226">226</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # <link href="http:..." rel="xxx" rev="xxx" title="xxx"> </td> </tr> <tr> <td class="h" > <a name="227">227</a> </td> <td class="c3" > 6 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td > 14 </td> <td class="s"> my $href = delete($attr->{href}); </td> </tr> <tr> <td class="h" > <a name="228">228</a> </td> <td class="c3" > 6 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td > 17 </td> <td class="s"> $href =~ s/^\s+//; $href =~ s/\s+$//; # HTML5 </td> </tr> <tr> <td class="h" > <a > </a> </td> <td class="c3" > 6 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td > 16 </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="229">229</a> </td> <td class="c3" > 6 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td > 19 </td> <td class="s"> my $h_val = "<$href>"; </td> </tr> <tr> <td class="h" > <a name="230">230</a> </td> <td class="c3" > 6 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td > 8 </td> <td class="s"> for (sort keys %{$attr}) { </td> </tr> <tr> <td class="h" > <a > </a> </td> <td class="c3" > 6 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td > 37 </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="231">231</a> </td> <td class="c3" > 16 </td> <td class="c3" > <a href="blib-lib-HTML-HeadParser-pm--branch.html#231-1"> 100 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td > 33 </td> <td class="s"> next if $_ eq "/"; # XHTML junk </td> </tr> <tr> <td class="h" > <a name="232">232</a> </td> <td class="c3" > 13 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td > 38 </td> <td class="s"> $h_val .= qq(; $_="$attr->{$_}"); </td> </tr> <tr> <td class="h" > <a name="233">233</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="234">234</a> </td> <td class="c3" > 6 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td > 20 </td> <td class="s"> $self->{'header'}->push_header(Link => $h_val); </td> </tr> <tr> <td class="h" > <a name="235">235</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } elsif ($tag eq 'head' || $tag eq 'html') { </td> </tr> <tr> <td class="h" > <a name="236">236</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # ignore </td> </tr> <tr> <td class="h" > <a name="237">237</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } else { </td> </tr> <tr> <td class="h" > <a name="238">238</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # stop parsing </td> </tr> <tr> <td class="h" > <a name="239">239</a> </td> <td class="c0" > <a href="# "> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td > 0 </td> <td class="s"> $self->eof; </td> </tr> <tr> <td class="h" > <a name="240">240</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="241">241</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="242">242</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="243">243</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> sub end </td> </tr> <tr> <td class="h" > <a name="244">244</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> { </td> </tr> <tr> <td class="h" > <a name="245">245</a> </td> <td class="c3" > 12 </td> <td >   </td> <td >   </td> <td class="c3" > <a href="blib-lib-HTML-HeadParser-pm--subroutine.html#245-1"> 12 </a> </td> <td class="c3" > <a href="blib-lib-HTML-HeadParser-pm--subroutine.html#245-1"> 1 </a> </td> <td > 65 </td> <td class="s"> my($self, $tag) = @_; </td> </tr> <tr> <td class="h" > <a name="246">246</a> </td> <td class="c3" > 12 </td> <td class="c0" > <a href="blib-lib-HTML-HeadParser-pm--branch.html#246-1"> 50 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td > 23 </td> <td class="s"> print "END[$tag]\n" if $DEBUG; </td> </tr> <tr> <td class="h" > <a name="247">247</a> </td> <td class="c3" > 12 </td> <td class="c3" > <a href="blib-lib-HTML-HeadParser-pm--branch.html#247-1"> 100 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td > 39 </td> <td class="s"> $self->flush_text if $self->{'tag'}; </td> </tr> <tr> <td class="h" > <a name="248">248</a> </td> <td class="c3" > 12 </td> <td class="c3" > <a href="blib-lib-HTML-HeadParser-pm--branch.html#248-1"> 100 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td > 64 </td> <td class="s"> $self->eof if $tag eq 'head'; </td> </tr> <tr> <td class="h" > <a name="249">249</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="250">250</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="251">251</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> sub text </td> </tr> <tr> <td class="h" > <a name="252">252</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> { </td> </tr> <tr> <td class="h" > <a name="253">253</a> </td> <td class="c3" > 71 </td> <td >   </td> <td >   </td> <td class="c3" > <a href="blib-lib-HTML-HeadParser-pm--subroutine.html#253-1"> 71 </a> </td> <td class="c3" > <a href="blib-lib-HTML-HeadParser-pm--subroutine.html#253-1"> 1 </a> </td> <td > 1128 </td> <td class="s"> my($self, $text) = @_; </td> </tr> <tr> <td class="h" > <a name="254">254</a> </td> <td class="c3" > 71 </td> <td class="c0" > <a href="blib-lib-HTML-HeadParser-pm--branch.html#254-1"> 50 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td > 138 </td> <td class="s"> print "TEXT[$text]\n" if $DEBUG; </td> </tr> <tr> <td class="h" > <a name="255">255</a> </td> <td class="c3" > 71 </td> <td class="c3" > <a href="blib-lib-HTML-HeadParser-pm--branch.html#255-1"> 100 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td > 143 </td> <td class="s"> unless ($self->{first_chunk}) { </td> </tr> <tr> <td class="h" > <a name="256">256</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # drop Unicode BOM if found </td> </tr> <tr> <td class="h" > <a name="257">257</a> </td> <td class="c3" > 8 </td> <td class="c3" > <a href="blib-lib-HTML-HeadParser-pm--branch.html#257-1"> 100 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td > 31 </td> <td class="s"> if ($self->utf8_mode) { </td> </tr> <tr> <td class="h" > <a name="258">258</a> </td> <td class="c3" > 2 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td > 7 </td> <td class="s"> $text =~ s/^\xEF\xBB\xBF//; </td> </tr> <tr> <td class="h" > <a name="259">259</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="260">260</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> else { </td> </tr> <tr> <td class="h" > <a name="261">261</a> </td> <td class="c3" > 6 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td > 25 </td> <td class="s"> $text =~ s/^\x{FEFF}//; </td> </tr> <tr> <td class="h" > <a name="262">262</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="263">263</a> </td> <td class="c3" > 8 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td > 20 </td> <td class="s"> $self->{first_chunk}++; </td> </tr> <tr> <td class="h" > <a name="264">264</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="265">265</a> </td> <td class="c3" > 71 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td > 101 </td> <td class="s"> my $tag = $self->{tag}; </td> </tr> <tr> <td class="h" > <a name="266">266</a> </td> <td class="c3" > 71 </td> <td class="c3" > <a href="blib-lib-HTML-HeadParser-pm--branch.html#266-1"> 100 </a> </td> <td class="c3" > <a href="blib-lib-HTML-HeadParser-pm--condition.html#266-1"> 100 </a> </td> <td >   </td> <td >   </td> <td > 263 </td> <td class="s"> if (!$tag && $text =~ /\S/) { </td> </tr> <tr> <td class="h" > <a name="267">267</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # Normal text means start of body </td> </tr> <tr> <td class="h" > <a name="268">268</a> </td> <td class="c3" > 5 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td > 24 </td> <td class="s"> $self->eof; </td> </tr> <tr> <td class="h" > <a name="269">269</a> </td> <td class="c3" > 5 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td > 24 </td> <td class="s"> return; </td> </tr> <tr> <td class="h" > <a name="270">270</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="271">271</a> </td> <td class="c3" > 66 </td> <td class="c3" > <a href="blib-lib-HTML-HeadParser-pm--branch.html#271-1"> 100 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td > 408 </td> <td class="s"> return if $tag ne 'title'; </td> </tr> <tr> <td class="h" > <a name="272">272</a> </td> <td class="c3" > 7 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td > 44 </td> <td class="s"> $self->{'text'} .= $text; </td> </tr> <tr> <td class="h" > <a name="273">273</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="274">274</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="275">275</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> BEGIN { </td> </tr> <tr> <td class="h" > <a name="276">276</a> </td> <td class="c3" > 2 </td> <td class="c0" > <a href="blib-lib-HTML-HeadParser-pm--branch.html#276-1"> 50 </a> </td> <td >   </td> <td class="c3" > <a href="blib-lib-HTML-HeadParser-pm--subroutine.html#276-1"> 2 </a> </td> <td >   </td> <td > 78 </td> <td class="s"> *utf8_mode = sub { 1 } unless HTML::Entities::UNICODE_SUPPORT; </td> </tr> <tr> <td class="h" > <a > </a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td > 0 </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="277">277</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="278">278</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="279">279</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> 1; </td> </tr> <tr> <td class="h" > <a name="280">280</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="281">281</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> __END__ </td> </tr> </table> </body> </html>