.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.40) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" ======================================================================== .\" .IX Title "FormArticle 3pm" .TH FormArticle 3pm "2020-12-26" "perl v5.32.0" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" News::FormArticle \- derivative of News::Article .SH "SYNOPSIS" .IX Header "SYNOPSIS" .Vb 1 \& use News::FormArticle; .Ve .PP See below for functions available. .SH "DESCRIPTION" .IX Header "DESCRIPTION" Like News::Article, but designed to be constructed from a file containing form text with substitutions. .PP Currently, the source text is substituted as follows: .PP Variables are denoted by \f(CW$NAME\fR or \f(CW@NAME\fR (where \s-1NAME\s0 is any simple identifier). (The sequences $$ and @@ denote literal $ and @ characters.) Variables of the form \f(CW$NAME\fR are expected to supply scalar values which are interpolated; variables of the form \f(CW@NAME\fR are expected to supply lists (or references to arrays) which are interpolated with separating newlines. .PP Values of variables are found by consulting the list of sources supplied. Each source may be either a reference to a hash, or a reference to code. .PP Source hashes may contain as values either the desired value (scalar or reference to array), or a typeglob, or a code reference which will be called to return the result. (Since typeglobs are allowed values, it is possible to supply a reference to a module symbol table as a valid source.) .PP Code references supplied as sources are invoked with the variable name (including the leading $ or @) as the only parameter. In the degenerate case, all variables accessible in the source scope may be made available for interpolation by supplying the following as a source: .PP .Vb 1 \& sub { eval shift } .Ve .PP If multiple sources are supplied, then each is consulted in turn until a defined value is found. .SH "USAGE" .IX Header "USAGE" .Vb 1 \& use News::FormArticle; .Ve .PP Exports nothing. .SH "Constructor" .IX Header "Constructor" .IP "new ( \s-1FILE\s0 [, \s-1SOURCE\s0 [...]] )" 4 .IX Item "new ( FILE [, SOURCE [...]] )" Construct an article from the specified file, performing variable substitution with values supplied by the \f(CW\*(C`SOURCE\*(C'\fR parameters (see Description). \s-1FILE\s0 is any form of data recognised by News::Article\e's \&\fBread()\fR method. .SH "AUTHOR" .IX Header "AUTHOR" Andrew Gierth .SH "COPYRIGHT" .IX Header "COPYRIGHT" Copyright 1997 Andrew Gierth .PP This code may be used and/or distributed under the same terms as Perl itself.