File Coverage

blib/lib/PFT/Header.pm
Criterion Covered Total %
statement 107 115 93.0
branch 42 62 67.7
condition 18 31 58.0
subroutine 24 25 96.0
pod 10 12 83.3
total 201 245 82.0


line stmt bran cond sub pod time code
1             # Copyright 2014-2016 - Giovanni Simoni
2             #
3             # This file is part of PFT.
4             #
5             # PFT is free software: you can redistribute it and/or modify it under the
6             # terms of the GNU General Public License as published by the Free
7             # Software Foundation, either version 3 of the License, or (at your
8             # option) any later version.
9             #
10             # PFT is distributed in the hope that it will be useful, but WITHOUT ANY
11             # WARRANTY; without even the implied warranty of MERCHANTABILITY or
12             # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
13             # for more details.
14             #
15             # You should have received a copy of the GNU General Public License along
16             # with PFT. If not, see .
17             #
18             package PFT::Header v1.3.0;
19              
20             =encoding utf8
21              
22             =head1 NAME
23              
24             PFT::Header - Header for PFT content textfiles
25              
26             =head1 SYNOPSIS
27              
28             use PFT::Header;
29              
30             my $hdr = PFT::Header->new(
31             title => $title, # mandatory (conditions apply)
32             slug => $slug, # optional short identifier
33             date => $date, # optional (conditions apply) PFT::Date
34             author => $author, # optional
35             tags => $tags, # list of decoded strins, defaults to []
36             opts => $opts, # ignored by internals, defaults to {}
37             );
38              
39             my $hdr = PFT::Header->load(\*STDIN);
40              
41             my $hdr = PFT::Header->load('/path/to/file');
42              
43             =head1 DESCRIPTION
44              
45             A header is a chunk of meta-information describing content properties.
46              
47             It is used in a PFT::Tree::Content structure as index for retrieving the
48             content on the filesystem. Every textual content (i.e.
49             PFT::Content::Entry) stores a textual representation of an header in the
50             beginning of the file.
51              
52             =head2 Structure
53              
54             Each content has a I, an optional I<author>, an optional list of </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"> I<tags> in form of strings, an optional hash I<opts> containing other </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"> options. </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">   </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"> =head2 Textual representation </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">   </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"> The textual representation of a header starts with a valid YAML document </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"> (including the leading '---' line and ends with another '---' line). </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">   </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"> =head2 Construction </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">   </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"> The header can be constructed in three ways, corresponding to the three </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"> forms in the B<SYNOPSIS>. </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">   </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"> The first form is constructed in code. The I<title> field is mandatory </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"> unless there is a I<date> field, and the date represents a month (i.e. </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"> lacks the I<day> field). This property is enforced by the constructor. </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">   </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"> The second and third forms are equivalent, and they differ in the source </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"> from which a header is loaded (a stream or a file path, respectively). </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">   </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"> =cut </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">   </td> </tr> <tr> <td class="h" > <a name="77">77</a> </td> <td class="c3" > 7 </td> <td >   </td> <td >   </td> <td class="c3" > <a href="blib-lib-PFT-Header-pm--subroutine.html#77-1"> 7 </a> </td> <td >   </td> <td > 100261 </td> <td class="s"> use utf8; </td> </tr> <tr> <td class="h" > <a > </a> </td> <td class="c3" > 7 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td > 22 </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a > </a> </td> <td class="c3" > 7 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td > 36 </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="78">78</a> </td> <td class="c3" > 7 </td> <td >   </td> <td >   </td> <td class="c3" > <a href="blib-lib-PFT-Header-pm--subroutine.html#78-1"> 7 </a> </td> <td >   </td> <td > 226 </td> <td class="s"> use v5.16; </td> </tr> <tr> <td class="h" > <a > </a> </td> <td class="c3" > 7 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td > 23 </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="79">79</a> </td> <td class="c3" > 7 </td> <td >   </td> <td >   </td> <td class="c3" > <a href="blib-lib-PFT-Header-pm--subroutine.html#79-1"> 7 </a> </td> <td >   </td> <td > 34 </td> <td class="s"> use strict; </td> </tr> <tr> <td class="h" > <a > </a> </td> <td class="c3" > 7 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td > 12 </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a > </a> </td> <td class="c3" > 7 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td > 140 </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="80">80</a> </td> <td class="c3" > 7 </td> <td >   </td> <td >   </td> <td class="c3" > <a href="blib-lib-PFT-Header-pm--subroutine.html#80-1"> 7 </a> </td> <td >   </td> <td > 93 </td> <td class="s"> use warnings; </td> </tr> <tr> <td class="h" > <a > </a> </td> <td class="c3" > 7 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td > 15 </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a > </a> </td> <td class="c3" > 7 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td > 230 </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">   </td> </tr> <tr> <td class="h" > <a name="82">82</a> </td> <td class="c3" > 7 </td> <td >   </td> <td >   </td> <td class="c3" > <a href="blib-lib-PFT-Header-pm--subroutine.html#82-1"> 7 </a> </td> <td >   </td> <td > 38 </td> <td class="s"> use Carp; </td> </tr> <tr> <td class="h" > <a > </a> </td> <td class="c3" > 7 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td > 13 </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a > </a> </td> <td class="c3" > 7 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td > 415 </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="83">83</a> </td> <td class="c3" > 7 </td> <td >   </td> <td >   </td> <td class="c3" > <a href="blib-lib-PFT-Header-pm--subroutine.html#83-1"> 7 </a> </td> <td >   </td> <td > 484 </td> <td class="s"> use Encode::Locale; </td> </tr> <tr> <td class="h" > <a > </a> </td> <td class="c3" > 7 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td > 3351 </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a > </a> </td> <td class="c3" > 7 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td > 272 </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="84">84</a> </td> <td class="c3" > 7 </td> <td >   </td> <td >   </td> <td class="c3" > <a href="blib-lib-PFT-Header-pm--subroutine.html#84-1"> 7 </a> </td> <td >   </td> <td > 71 </td> <td class="s"> use Encode; </td> </tr> <tr> <td class="h" > <a > </a> </td> <td class="c3" > 7 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td > 14 </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a > </a> </td> <td class="c3" > 7 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td > 516 </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="85">85</a> </td> <td class="c3" > 7 </td> <td >   </td> <td >   </td> <td class="c3" > <a href="blib-lib-PFT-Header-pm--subroutine.html#85-1"> 7 </a> </td> <td >   </td> <td > 3874 </td> <td class="s"> use YAML::Tiny; </td> </tr> <tr> <td class="h" > <a > </a> </td> <td class="c3" > 7 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td > 40535 </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a > </a> </td> <td class="c3" > 7 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td > 464 </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">   </td> </tr> <tr> <td class="h" > <a name="87">87</a> </td> <td class="c3" > 7 </td> <td >   </td> <td >   </td> <td class="c3" > <a href="blib-lib-PFT-Header-pm--subroutine.html#87-1"> 7 </a> </td> <td >   </td> <td > 3519 </td> <td class="s"> use PFT::Date; </td> </tr> <tr> <td class="h" > <a > </a> </td> <td class="c3" > 7 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td > 20 </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a > </a> </td> <td class="c3" > 7 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td > 10072 </td> <td class="s">   </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 >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # Restrictions on header fields are handled by the following function, </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"> # as they are not just booleans. </td> </tr> <tr> <td class="h" > <a name="91">91</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> sub _params_check { </td> </tr> <tr> <td class="h" > <a name="92">92</a> </td> <td class="c3" > 217 </td> <td >   </td> <td >   </td> <td class="c3" > <a href="blib-lib-PFT-Header-pm--subroutine.html#92-1"> 217 </a> </td> <td >   </td> <td > 342 </td> <td class="s"> my $params = shift; </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">   </td> </tr> <tr> <td class="h" > <a name="94">94</a> </td> <td class="c3" > 217 </td> <td class="c3" > <a href="blib-lib-PFT-Header-pm--branch.html#94-1"> 100 </a> </td> <td class="c3" > <a href="blib-lib-PFT-Header-pm--condition.html#94-1"> 100 </a> </td> <td >   </td> <td >   </td> <td > 983 </td> <td class="s"> if (exists $params->{date} and defined(my $d = $params->{date})) { </td> </tr> <tr> <td class="h" > <a name="95">95</a> </td> <td class="c3" > 174 </td> <td class="c3" > <a href="blib-lib-PFT-Header-pm--branch.html#95-1"> 100 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td > 1020 </td> <td class="s"> $d->isa('PFT::Date') </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"> or confess 'date parameter must be PFT::Date'; </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 class="c3" > 173 </td> <td class="c3" > <a href="blib-lib-PFT-Header-pm--branch.html#98-1"> 100 </a> </td> <td class="c0" > <a href="blib-lib-PFT-Header-pm--condition.html#98-1"> 66 </a> </td> <td >   </td> <td >   </td> <td > 496 </td> <td class="s"> if ($d->complete) { </td> </tr> <tr> <td class="h" > <a > </a> </td> <td >   </td> <td class="c3" > <a href="blib-lib-PFT-Header-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 name="99">99</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> $params->{title} </td> </tr> <tr> <td class="h" > <a name="100">100</a> </td> <td class="c3" > 162 </td> <td class="c3" > <a href="blib-lib-PFT-Header-pm--branch.html#100-1"> 100 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td > 626 </td> <td class="s"> or croak 'Title is mandatory headers having complete date'; </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"> } elsif (!defined $d->y or !defined $d->m) { </td> </tr> <tr> <td class="h" > <a name="102">102</a> </td> <td class="c3" > 1 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td > 93 </td> <td class="s"> croak 'Year and month are mandatory for headers with date'; </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"> } </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"> } else { </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"> $params->{title} </td> </tr> <tr> <td class="h" > <a name="106">106</a> </td> <td class="c3" > 43 </td> <td class="c0" > <a href="blib-lib-PFT-Header-pm--branch.html#106-1"> 50 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td > 117 </td> <td class="s"> or croak 'Title is mandatory for headers not having dates'; </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"> }; </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"> # Keys are recognized options. Values are arrays: </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"> # - The default option; </td> </tr> <tr> <td class="h" > <a name="112">112</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # - The normalization callback, or undef if the normalization is the </td> </tr> <tr> <td class="h" > <a name="113">113</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # identity function. </td> </tr> <tr> <td class="h" > <a name="114">114</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> my %OPTS_RECIPE = ( </td> </tr> <tr> <td class="h" > <a name="115">115</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> hide => [0, sub { 0 + shift }], </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"> template => [undef, undef ], </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 >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </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"> sub _opts_default { </td> </tr> <tr> <td class="h" > <a name="120">120</a> </td> <td class="c3" > 62 </td> <td >   </td> <td >   </td> <td class="c3" > <a href="blib-lib-PFT-Header-pm--subroutine.html#120-1"> 62 </a> </td> <td >   </td> <td > 103 </td> <td class="s"> my %out; </td> </tr> <tr> <td class="h" > <a name="121">121</a> </td> <td class="c3" > 62 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td > 228 </td> <td class="s"> while (my($k, $vs) = each %OPTS_RECIPE) { </td> </tr> <tr> <td class="h" > <a name="122">122</a> </td> <td class="c3" > 124 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td > 438 </td> <td class="s"> $out{$k} = $vs->[0] </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" > 62 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td > 174 </td> <td class="s"> \%out </td> </tr> <tr> <td class="h" > <a name="125">125</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="126">126</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="127">127</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> sub _opts_normalize { </td> </tr> <tr> <td class="h" > <a name="128">128</a> </td> <td class="c3" > 206 </td> <td >   </td> <td >   </td> <td class="c3" > <a href="blib-lib-PFT-Header-pm--subroutine.html#128-1"> 206 </a> </td> <td >   </td> <td > 356 </td> <td class="s"> my $opts = shift; </td> </tr> <tr> <td class="h" > <a name="129">129</a> </td> <td class="c3" > 206 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td > 861 </td> <td class="s"> foreach (keys %$opts) { </td> </tr> <tr> <td class="h" > <a name="130">130</a> </td> <td class="c3" > 412 </td> <td class="c3" > <a href="blib-lib-PFT-Header-pm--branch.html#130-1"> 100 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td > 1193 </td> <td class="s"> if (defined(my $cb = $OPTS_RECIPE{$_}->[1])) { </td> </tr> <tr> <td class="h" > <a name="131">131</a> </td> <td class="c3" > 206 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td > 453 </td> <td class="s"> $opts->{$_} = $cb->($opts->{$_}) </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"> } </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"> $opts </td> </tr> <tr> <td class="h" > <a name="135">135</a> </td> <td class="c3" > 206 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td > 1098 </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">   </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"> sub new { </td> </tr> <tr> <td class="h" > <a name="138">138</a> </td> <td class="c3" > 65 </td> <td >   </td> <td >   </td> <td class="c3" > <a href="blib-lib-PFT-Header-pm--subroutine.html#138-1"> 65 </a> </td> <td class="c0" > <a href="blib-lib-PFT-Header-pm--subroutine.html#138-1"> 0 </a> </td> <td > 7056 </td> <td class="s"> my $cls = shift; </td> </tr> <tr> <td class="h" > <a name="139">139</a> </td> <td class="c3" > 65 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td > 245 </td> <td class="s"> my %params = @_; </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 class="c3" > 65 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td > 205 </td> <td class="s"> _params_check(\%params); </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"> bless { </td> </tr> <tr> <td class="h" > <a name="143">143</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> title => $params{title}, </td> </tr> <tr> <td class="h" > <a name="144">144</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> author => $params{author}, </td> </tr> <tr> <td class="h" > <a name="145">145</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> date => $params{date}, </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"> tags => $params{tags} || [], </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"> opts => $params{opts} || _opts_default(), </td> </tr> <tr> <td class="h" > <a name="148">148</a> </td> <td class="c3" > 62 </td> <td >   </td> <td class="c3" > <a href="blib-lib-PFT-Header-pm--condition.html#148-1"> 100 </a> </td> <td >   </td> <td >   </td> <td > 416 </td> <td class="s"> slug => do { </td> </tr> <tr> <td class="h" > <a > </a> </td> <td >   </td> <td >   </td> <td class="c0" > <a href="blib-lib-PFT-Header-pm--condition.html#-2"> 33 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="149">149</a> </td> <td class="c3" > 62 </td> <td >   </td> <td class="c3" > <a href="blib-lib-PFT-Header-pm--condition.html#149-1"> 100 </a> </td> <td >   </td> <td >   </td> <td > 192 </td> <td class="s"> my $given = $params{slug} || $params{title}; </td> </tr> <tr> <td class="h" > <a name="150">150</a> </td> <td class="c3" > 62 </td> <td class="c3" > <a href="blib-lib-PFT-Header-pm--branch.html#150-1"> 100 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td > 213 </td> <td class="s"> defined $given ? slugify($given) : undef </td> </tr> <tr> <td class="h" > <a name="151">151</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="152">152</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> }, $cls; </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">   </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"> sub load { </td> </tr> <tr> <td class="h" > <a name="156">156</a> </td> <td class="c3" > 154 </td> <td >   </td> <td >   </td> <td class="c3" > <a href="blib-lib-PFT-Header-pm--subroutine.html#156-1"> 154 </a> </td> <td class="c0" > <a href="blib-lib-PFT-Header-pm--subroutine.html#156-1"> 0 </a> </td> <td > 1874 </td> <td class="s"> my($cls, $from) = @_; </td> </tr> <tr> <td class="h" > <a name="157">157</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="158">158</a> </td> <td class="c3" > 154 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td > 228 </td> <td class="s"> my $fname; </td> </tr> <tr> <td class="h" > <a name="159">159</a> </td> <td class="c3" > 154 </td> <td class="c3" > <a href="blib-lib-PFT-Header-pm--branch.html#159-1"> 100 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td > 417 </td> <td class="s"> if (my $type = ref $from) { </td> </tr> <tr> <td class="h" > <a name="160">160</a> </td> <td class="c3" > 84 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td > 201 </td> <td class="s"> $fname = "?? $type ??"; </td> </tr> <tr> <td class="h" > <a name="161">161</a> </td> <td class="c3" > 84 </td> <td class="c0" > <a href="blib-lib-PFT-Header-pm--branch.html#161-1"> 50 </a> </td> <td class="c0" > <a href="blib-lib-PFT-Header-pm--condition.html#161-1"> 66 </a> </td> <td >   </td> <td >   </td> <td > 364 </td> <td class="s"> unless ($type eq 'GLOB' || $type eq 'IO::File') { </td> </tr> <tr> <td class="h" > <a name="162">162</a> </td> <td class="c0" > <a href="#209"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td > 0 </td> <td class="s"> confess "Only supporting GLOB and IO::File. Got $type"; </td> </tr> <tr> <td class="h" > <a name="163">163</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="164">164</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="165">165</a> </td> <td class="c3" > 70 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td > 130 </td> <td class="s"> $fname = $from; </td> </tr> <tr> <td class="h" > <a name="166">166</a> </td> <td class="c3" > 70 </td> <td class="c0" > <a href="blib-lib-PFT-Header-pm--branch.html#166-1"> 50 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td > 490 </td> <td class="s"> $from = IO::File->new($from) or confess "Cannot open $from"; </td> </tr> <tr> <td class="h" > <a name="167">167</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="168">168</a> </td> <td class="c3" > 154 </td> <td class="c0" > <a href="blib-lib-PFT-Header-pm--branch.html#168-1"> 50 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td > 11233 </td> <td class="s"> binmode $from, ':encoding(locale)' or confess "Binmode: $!"; </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 >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # Header starts with a valid YAML document (including the leading </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"> # /^---$/ string) and ends with another /^---$/ string. </td> </tr> <tr> <td class="h" > <a name="172">172</a> </td> <td class="c3" > 154 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td > 10411 </td> <td class="s"> my $text = <$from>; </td> </tr> <tr> <td class="h" > <a name="173">173</a> </td> <td class="c3" > 154 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td > 408 </td> <td class="s"> local $_; </td> </tr> <tr> <td class="h" > <a name="174">174</a> </td> <td class="c3" > 154 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td > 575 </td> <td class="s"> while (<$from>) { </td> </tr> <tr> <td class="h" > <a name="175">175</a> </td> <td class="c3" > 1401 </td> <td class="c3" > <a href="blib-lib-PFT-Header-pm--branch.html#175-1"> 100 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td > 2816 </td> <td class="s"> last if ($_ =~ /^---$/); </td> </tr> <tr> <td class="h" > <a name="176">176</a> </td> <td class="c3" > 1249 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td > 2516 </td> <td class="s"> $text .= $_; </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"> } </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">   </td> </tr> <tr> <td class="h" > <a name="179">179</a> </td> <td class="c3" > 154 </td> <td >   </td> <td class="c0" > <a href="blib-lib-PFT-Header-pm--condition.html#179-1"> 50 </a> </td> <td >   </td> <td >   </td> <td > 261 </td> <td class="s"> my $hdr = eval { YAML::Tiny::Load($text || '') }; </td> </tr> <tr> <td class="h" > <a > </a> </td> <td class="c3" > 154 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td > 638 </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="180">180</a> </td> <td class="c3" > 154 </td> <td class="c3" > <a href="blib-lib-PFT-Header-pm--branch.html#180-1"> 100 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td > 73167 </td> <td class="s"> $hdr or confess "File $fname has corrupt header"; </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 class="c3" > 152 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td > 243 </td> <td class="s"> my $date; </td> </tr> <tr> <td class="h" > <a name="183">183</a> </td> <td class="c3" > 152 </td> <td class="c3" > <a href="blib-lib-PFT-Header-pm--branch.html#183-1"> 100 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td > 397 </td> <td class="s"> $hdr->{Date} and $date = eval { </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"> PFT::Date->from_string($hdr->{Date}) </td> </tr> <tr> <td class="h" > <a name="185">185</a> </td> <td class="c3" > 125 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td > 817 </td> <td class="s"> }; </td> </tr> <tr> <td class="h" > <a name="186">186</a> </td> <td class="c3" > 152 </td> <td class="c0" > <a href="blib-lib-PFT-Header-pm--branch.html#186-1"> 50 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td > 344 </td> <td class="s"> croak $@ =~ s/ at .*$//rs if $@; </td> </tr> <tr> <td class="h" > <a name="187">187</a> </td> <td class="c3" > 152 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td > 373 </td> <td class="s"> delete $hdr->{Date}; </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">   </td> </tr> <tr> <td class="h" > <a name="189">189</a> </td> <td class="c3" > 152 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td > 297 </td> <td class="s"> my $title = delete $hdr->{Title}; </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"> my $self = { </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"> title => $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"> slug => do { </td> </tr> <tr> <td class="h" > <a name="193">193</a> </td> <td class="c3" > 152 </td> <td >   </td> <td class="c0" > <a href="blib-lib-PFT-Header-pm--condition.html#193-1"> 33 </a> </td> <td >   </td> <td >   </td> <td > 384 </td> <td class="s"> my $given = delete $hdr->{Slug} || $title; </td> </tr> <tr> <td class="h" > <a name="194">194</a> </td> <td class="c3" > 152 </td> <td class="c0" > <a href="blib-lib-PFT-Header-pm--branch.html#194-1"> 50 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td > 420 </td> <td class="s"> defined $given ? slugify($given) : undef </td> </tr> <tr> <td class="h" > <a name="195">195</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="196">196</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> author => delete $hdr->{Author}, </td> </tr> <tr> <td class="h" > <a name="197">197</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> tags => [ do { </td> </tr> <tr> <td class="h" > <a name="198">198</a> </td> <td class="c3" > 152 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td > 317 </td> <td class="s"> my $tags = delete $hdr->{Tags}; </td> </tr> <tr> <td class="h" > <a name="199">199</a> </td> <td class="c3" > 152 </td> <td class="c0" > <a href="blib-lib-PFT-Header-pm--branch.html#199-1"> 50 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td > 788 </td> <td class="s"> ref $tags eq 'ARRAY' ? @$tags </td> </tr> <tr> <td class="h" > <a > </a> </td> <td >   </td> <td class="c3" > <a href="blib-lib-PFT-Header-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 name="200">200</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> : defined $tags ? $tags </td> </tr> <tr> <td class="h" > <a name="201">201</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="202">202</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="203">203</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> date => $date, </td> </tr> <tr> <td class="h" > <a name="204">204</a> </td> <td class="c3" > 152 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td > 261 </td> <td class="s"> opts => _opts_normalize(delete $hdr->{Options}), </td> </tr> <tr> <td class="h" > <a name="205">205</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="206">206</a> </td> <td class="c3" > 152 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td > 426 </td> <td class="s"> _params_check($self); </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">   </td> </tr> <tr> <td class="h" > <a name="208">208</a> </td> <td class="c3" > 152 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td > 451 </td> <td class="s"> foreach (keys %$hdr) { </td> </tr> <tr> <td class="h" > <a name="209">209</a> </td> <td class="c0" > <a href="# "> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td > 0 </td> <td class="s"> warn 'Unexpected key in header: ', $_; </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" > 152 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td > 219 </td> <td class="s"> foreach (keys %{$self->{opts}}) { </td> </tr> <tr> <td class="h" > <a > </a> </td> <td class="c3" > 152 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td > 416 </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="212">212</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> warn 'Unexpected key in header: opts.', $_ </td> </tr> <tr> <td class="h" > <a name="213">213</a> </td> <td class="c3" > 304 </td> <td class="c0" > <a href="blib-lib-PFT-Header-pm--branch.html#213-1"> 50 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td > 754 </td> <td class="s"> unless exists $OPTS_RECIPE{$_} </td> </tr> <tr> <td class="h" > <a name="214">214</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="215">215</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="216">216</a> </td> <td class="c3" > 152 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td > 3309 </td> <td class="s"> bless $self, $cls; </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"> } </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">   </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"> =head2 Functions </td> </tr> <tr> <td class="h" > <a name="220">220</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="221">221</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> The following functions are not associated with an instance. Call them as </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"> C<PFT::Header::function(...)> </td> </tr> <tr> <td class="h" > <a name="223">223</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="224">224</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> =over </td> </tr> <tr> <td class="h" > <a name="225">225</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="226">226</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> =item slugify </td> </tr> <tr> <td class="h" > <a name="227">227</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="228">228</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> Given a string, construct a I<slug>, that is a simplified version of such </td> </tr> <tr> <td class="h" > <a name="229">229</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> string. </td> </tr> <tr> <td class="h" > <a name="230">230</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="231">231</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> (TODO: better describe it, also w.r.t. Unicode) </td> </tr> <tr> <td class="h" > <a name="232">232</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="233">233</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="234">234</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="235">235</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> sub slugify { </td> </tr> <tr> <td class="h" > <a name="236">236</a> </td> <td class="c3" > 223 </td> <td >   </td> <td >   </td> <td class="c3" > <a href="blib-lib-PFT-Header-pm--subroutine.html#236-1"> 223 </a> </td> <td class="c3" > <a href="blib-lib-PFT-Header-pm--subroutine.html#236-1"> 1 </a> </td> <td > 466 </td> <td class="s"> my $out = shift; </td> </tr> <tr> <td class="h" > <a name="237">237</a> </td> <td class="c3" > 223 </td> <td class="c0" > <a href="blib-lib-PFT-Header-pm--branch.html#237-1"> 50 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td > 476 </td> <td class="s"> confess 'Slugify of nothing?' unless $out; </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">   </td> </tr> <tr> <td class="h" > <a name="239">239</a> </td> <td class="c3" > 223 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td > 1365 </td> <td class="s"> $out =~ s/[\W_]/-/g; </td> </tr> <tr> <td class="h" > <a name="240">240</a> </td> <td class="c3" > 223 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td > 815 </td> <td class="s"> $out =~ s/-+$//; </td> </tr> <tr> <td class="h" > <a name="241">241</a> </td> <td class="c3" > 223 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td > 447 </td> <td class="s"> $out =~ s/^-+//; </td> </tr> <tr> <td class="h" > <a name="242">242</a> </td> <td class="c3" > 223 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td > 432 </td> <td class="s"> $out =~ s/--+/-/g; </td> </tr> <tr> <td class="h" > <a name="243">243</a> </td> <td class="c3" > 223 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td > 1698 </td> <td class="s"> lc $out </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 >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="246">246</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="247">247</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="248">248</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> =head2 Properties </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"> $hdr->title </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"> $hdr->author </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"> $hdr->template </td> </tr> <tr> <td class="h" > <a name="253">253</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> $hdr->tags </td> </tr> <tr> <td class="h" > <a name="254">254</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> $hdr->date </td> </tr> <tr> <td class="h" > <a name="255">255</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> $hdr->opts </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"> $hdr->slug </td> </tr> <tr> <td class="h" > <a name="257">257</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> $hdr->tags_slug </td> </tr> <tr> <td class="h" > <a name="258">258</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="259">259</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> =over </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">   </td> </tr> <tr> <td class="h" > <a name="261">261</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> =item title </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 >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> Returns the title of the content. </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 >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> Outputs a in decoded string. </td> </tr> <tr> <td class="h" > <a name="266">266</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="267">267</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="268">268</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="269">269</a> </td> <td class="c3" > 188 </td> <td >   </td> <td >   </td> <td class="c3" > <a href="blib-lib-PFT-Header-pm--subroutine.html#269-1"> 188 </a> </td> <td class="c3" > <a href="blib-lib-PFT-Header-pm--subroutine.html#269-1"> 1 </a> </td> <td > 1169 </td> <td class="s"> sub title { shift->{title} } </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 >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> =item author </td> </tr> <tr> <td class="h" > <a name="272">272</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="273">273</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> Returns the author of the content, or undef if there is no author. </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"> Outputs a in decoded string. </td> </tr> <tr> <td class="h" > <a name="276">276</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="277">277</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="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 class="c3" > 54 </td> <td >   </td> <td >   </td> <td class="c3" > <a href="blib-lib-PFT-Header-pm--subroutine.html#279-1"> 54 </a> </td> <td class="c3" > <a href="blib-lib-PFT-Header-pm--subroutine.html#279-1"> 1 </a> </td> <td > 198 </td> <td class="s"> sub author { shift->{author} } </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"> =item tags </td> </tr> <tr> <td class="h" > <a name="282">282</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="283">283</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> A list of tags declared by the header. </td> </tr> <tr> <td class="h" > <a name="284">284</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="285">285</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> The tags are in a normal (i.e. not slugified) form. For a slugified </td> </tr> <tr> <td class="h" > <a name="286">286</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> version use the C<tags_slug> method. </td> </tr> <tr> <td class="h" > <a name="287">287</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="288">288</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="289">289</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="290">290</a> </td> <td class="c3" > 74 </td> <td class="c0" > <a href="blib-lib-PFT-Header-pm--branch.html#290-1"> 50 </a> </td> <td >   </td> <td class="c3" > <a href="blib-lib-PFT-Header-pm--subroutine.html#290-1"> 74 </a> </td> <td class="c3" > <a href="blib-lib-PFT-Header-pm--subroutine.html#290-1"> 1 </a> </td> <td > 250 </td> <td class="s"> sub tags { wantarray ? @{shift->{tags}} : shift->{tags} } </td> </tr> <tr> <td class="h" > <a > </a> </td> <td class="c0" > <a href="#342"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td > 0 </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="291">291</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="292">292</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> =item date </td> </tr> <tr> <td class="h" > <a name="293">293</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="294">294</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> The date declared by the heade, as PFT::Date object. </td> </tr> <tr> <td class="h" > <a name="295">295</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="296">296</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="297">297</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="298">298</a> </td> <td class="c3" > 309 </td> <td >   </td> <td >   </td> <td class="c3" > <a href="blib-lib-PFT-Header-pm--subroutine.html#298-1"> 309 </a> </td> <td class="c3" > <a href="blib-lib-PFT-Header-pm--subroutine.html#298-1"> 1 </a> </td> <td > 940 </td> <td class="s"> sub date { shift->{date} } </td> </tr> <tr> <td class="h" > <a name="299">299</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="300">300</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> =item opts </td> </tr> <tr> <td class="h" > <a name="301">301</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="302">302</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> A list of options for this content. </td> </tr> <tr> <td class="h" > <a name="303">303</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="304">304</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="305">305</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="306">306</a> </td> <td class="c3" > 54 </td> <td class="c0" > <a href="blib-lib-PFT-Header-pm--branch.html#306-1"> 50 </a> </td> <td >   </td> <td class="c3" > <a href="blib-lib-PFT-Header-pm--subroutine.html#306-1"> 54 </a> </td> <td class="c3" > <a href="blib-lib-PFT-Header-pm--subroutine.html#306-1"> 1 </a> </td> <td > 202 </td> <td class="s"> sub opts { shift->{opts} || {} } </td> </tr> <tr> <td class="h" > <a name="307">307</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="308">308</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> =item slug </td> </tr> <tr> <td class="h" > <a name="309">309</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="310">310</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> A slug of the title. </td> </tr> <tr> <td class="h" > <a name="311">311</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="312">312</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="313">313</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="314">314</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> sub slug { </td> </tr> <tr> <td class="h" > <a name="315">315</a> </td> <td class="c3" > 123 </td> <td >   </td> <td >   </td> <td class="c3" > <a href="blib-lib-PFT-Header-pm--subroutine.html#315-1"> 123 </a> </td> <td class="c3" > <a href="blib-lib-PFT-Header-pm--subroutine.html#315-1"> 1 </a> </td> <td > 251 </td> <td class="s"> my $self = shift; </td> </tr> <tr> <td class="h" > <a name="316">316</a> </td> <td class="c3" > 123 </td> <td class="c0" > <a href="blib-lib-PFT-Header-pm--branch.html#316-1"> 0 </a> </td> <td class="c0" > <a href="blib-lib-PFT-Header-pm--condition.html#316-1"> 0 </a> </td> <td >   </td> <td >   </td> <td > 675 </td> <td class="s"> $self->{slug} || $self->{title} && slugify($self->{title}) || undef </td> </tr> <tr> <td class="h" > <a > </a> </td> <td >   </td> <td >   </td> <td class="c0" > <a href="blib-lib-PFT-Header-pm--condition.html#-2"> 33 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="317">317</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="318">318</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="319">319</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> =item tags_slug </td> </tr> <tr> <td class="h" > <a name="320">320</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="321">321</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> A list of tags as for the C<tags> method, but in slugified form. </td> </tr> <tr> <td class="h" > <a name="322">322</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="323">323</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="324">324</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="325">325</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> sub tags_slug { </td> </tr> <tr> <td class="h" > <a name="326">326</a> </td> <td class="c3" > 19 </td> <td class="c0" > <a href="blib-lib-PFT-Header-pm--branch.html#326-1"> 50 </a> </td> <td >   </td> <td class="c3" > <a href="blib-lib-PFT-Header-pm--subroutine.html#326-1"> 19 </a> </td> <td class="c3" > <a href="blib-lib-PFT-Header-pm--subroutine.html#326-1"> 1 </a> </td> <td > 25 </td> <td class="s"> map slugify($_) => @{shift->tags || []} </td> </tr> <tr> <td class="h" > <a > </a> </td> <td class="c3" > 19 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td > 33 </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="327">327</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="328">328</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="329">329</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="330">330</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="331">331</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> =head2 Methods </td> </tr> <tr> <td class="h" > <a name="332">332</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="333">333</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> =over </td> </tr> <tr> <td class="h" > <a name="334">334</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="335">335</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> =item set_date </td> </tr> <tr> <td class="h" > <a name="336">336</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="337">337</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> Setter for date. The parameter must be a PFT::Date object. </td> </tr> <tr> <td class="h" > <a name="338">338</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="339">339</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="340">340</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="341">341</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> sub set_date { </td> </tr> <tr> <td class="h" > <a name="342">342</a> </td> <td class="c0" > <a href="#343"> 0 </a> </td> <td >   </td> <td >   </td> <td class="c0" > <a href="blib-lib-PFT-Header-pm--subroutine.html#342-1"> 0 </a> </td> <td class="c3" > <a href="blib-lib-PFT-Header-pm--subroutine.html#342-1"> 1 </a> </td> <td > 0 </td> <td class="s"> my $self = shift; </td> </tr> <tr> <td class="h" > <a name="343">343</a> </td> <td class="c0" > <a href="#345"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td > 0 </td> <td class="s"> my $date = pop; </td> </tr> <tr> <td class="h" > <a name="344">344</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="345">345</a> </td> <td class="c0" > <a href="#346"> 0 </a> </td> <td class="c0" > <a href="blib-lib-PFT-Header-pm--branch.html#345-1"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td > 0 </td> <td class="s"> $date->isa('PFT::Date') or confess 'Must be PFT::Date'; </td> </tr> <tr> <td class="h" > <a name="346">346</a> </td> <td class="c0" > <a href="#361"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td > 0 </td> <td class="s"> $self->{date} = $date; </td> </tr> <tr> <td class="h" > <a name="347">347</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="348">348</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="349">349</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> =item dump </td> </tr> <tr> <td class="h" > <a name="350">350</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="351">351</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> Dump the header on a file. A GLOB or IO::File is expected as argument. </td> </tr> <tr> <td class="h" > <a name="352">352</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="353">353</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="354">354</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="355">355</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> sub dump { </td> </tr> <tr> <td class="h" > <a name="356">356</a> </td> <td class="c3" > 54 </td> <td >   </td> <td >   </td> <td class="c3" > <a href="blib-lib-PFT-Header-pm--subroutine.html#356-1"> 54 </a> </td> <td class="c3" > <a href="blib-lib-PFT-Header-pm--subroutine.html#356-1"> 1 </a> </td> <td > 1534 </td> <td class="s"> my $self = shift; </td> </tr> <tr> <td class="h" > <a name="357">357</a> </td> <td class="c3" > 54 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td > 98 </td> <td class="s"> my $to = shift; </td> </tr> <tr> <td class="h" > <a name="358">358</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="359">359</a> </td> <td class="c3" > 54 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td > 108 </td> <td class="s"> my $type = ref $to; </td> </tr> <tr> <td class="h" > <a name="360">360</a> </td> <td class="c3" > 54 </td> <td class="c0" > <a href="blib-lib-PFT-Header-pm--branch.html#360-1"> 50 </a> </td> <td class="c0" > <a href="blib-lib-PFT-Header-pm--condition.html#360-1"> 66 </a> </td> <td >   </td> <td >   </td> <td > 271 </td> <td class="s"> if ($type ne 'GLOB' && $type ne 'IO::File') { </td> </tr> <tr> <td class="h" > <a name="361">361</a> </td> <td class="c0" > 0 </td> <td class="c0" > <a href="blib-lib-PFT-Header-pm--branch.html#361-1"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td > 0 </td> <td class="s"> confess "Only supporting GLOB and IO::File. Got ", </td> </tr> <tr> <td class="h" > <a name="362">362</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> $type ? $type : 'Scalar' </td> </tr> <tr> <td class="h" > <a name="363">363</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="364">364</a> </td> <td class="c3" > 54 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td > 134 </td> <td class="s"> my $tags = $self->tags; </td> </tr> <tr> <td class="h" > <a name="365">365</a> </td> <td class="c3" > 54 </td> <td class="c0" > <a href="blib-lib-PFT-Header-pm--branch.html#365-1"> 50 </a> </td> <td >   </td> <td class="c3" > <a href="blib-lib-PFT-Header-pm--subroutine.html#365-1"> 1 </a> </td> <td >   </td> <td > 624 </td> <td class="s"> binmode $to, ':encoding(locale)' or confess "Cannot binmode: $!"; </td> </tr> <tr> <td class="h" > <a > </a> </td> <td class="c3" > 1 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td > 7 </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a > </a> </td> <td class="c3" > 1 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td > 2 </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a > </a> </td> <td class="c3" > 1 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td > 18 </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="366">366</a> </td> <td class="c3" > 54 </td> <td class="c3" > <a href="blib-lib-PFT-Header-pm--branch.html#366-1"> 100 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td > 3105 </td> <td class="s"> print $to YAML::Tiny::Dump({ </td> </tr> <tr> <td class="h" > <a > </a> </td> <td >   </td> <td class="c3" > <a href="blib-lib-PFT-Header-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 name="367">367</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> Title => $self->title, </td> </tr> <tr> <td class="h" > <a name="368">368</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> Slug => $self->slug, </td> </tr> <tr> <td class="h" > <a name="369">369</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> Author => $self->author, </td> </tr> <tr> <td class="h" > <a name="370">370</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> Tags => @$tags ? $tags : undef, </td> </tr> <tr> <td class="h" > <a name="371">371</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> Date => $self->date ? $self->date->repr('-') : undef, </td> </tr> <tr> <td class="h" > <a name="372">372</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> Options => _opts_normalize($self->opts), </td> </tr> <tr> <td class="h" > <a name="373">373</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> }), "---\n"; </td> </tr> <tr> <td class="h" > <a name="374">374</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="375">375</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="376">376</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="377">377</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="378">378</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="379">379</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="380">380</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> 1; </td> </tr> </table> </body> </html>