1PFT::Content::Entry(3)User Contributed Perl DocumentationPFT::Content::Entry(3)
2
3
4
6 PFT::Content::Entry - Content edited by user.
7
9 use PFT::Content::Entry;
10
11 my $p = PFT::Content::Entry->new({
12 tree => $tree,
13 path => $path,
14 name => $name,
15 })
16
18 "PFT::Content::Entry" is the basetype for all text-based content files.
19 It inherits from "PFT::Content::File" and has two specific subtypes:
20 "PFT::Content::Blog" (representing an entry with date) and
21 "PFT::Content::Page" (representing an entry withouth date).
22
23 Methods
24 open
25 Open the file, return a file handler. Sets the binmode according to
26 the locale.
27
28 header
29 Reads the header from the page.
30
31 Returns undef if the entry is not backed by a file. Croaks if the
32 file does not contain a healty header.
33
34 read
35 Read the page.
36
37 In scalar context returns an open file descriptor configured with
38 the correct "binmode" according to the header. In list context
39 returns the header and the same descriptor. Returns "undef" if the
40 file does not exist.
41
42 Croaks if the header is broken.
43
44 void
45 Evaluates as true if the entry is void, that is if the file does
46 not exist, or if it contains only the header.
47
48 set_header
49 Sets a new header, passed by parameter.
50
51 This will rewrite the file. Content will be maintained.
52
53 make_consistent
54 Make page consistent with the filesystem tree.
55
57 Hey! The above document had some coding errors, which are explained
58 below:
59
60 Around line 43:
61 =back without =over
62
63
64
65perl v5.34.0 2021-07-22 PFT::Content::Entry(3)