1 .TH GPERL @MAN1EXT@ "@MDATE@" "Groff Version @VERSION@"
3 gperl \- groff preprocessor for Perl parts in roff files
5 .\" The .SH was moved to this place in order to appease `apropos'.
7 .\" --------------------------------------------------------------------
9 .\" --------------------------------------------------------------------
12 This file was written by
13 .MT groff-bernd.warken-72@web.de
19 Copyright \[co] 2014 Free Software Foundation, Inc.
26 a free software project.
28 You can redistribute it and/or modify it under the terms of the
30 .B "GNU General Public License"
34 .BR "Free Software Foundation" ,
39 The license text is available in the internet at
40 .UR http://www.gnu.org/licenses/gpl-2.0.html
44 .\" --------------------------------------------------------------------
46 .\" --------------------------------------------------------------------
49 .ie t .ds EL \fS\N'188'\fP
50 .el .ds EL \&.\|.\|.\&\
56 .\" used in `.IP \*(BU 2m' (former .Topic)
59 .\" --------------------------------------------------------------------
61 .\" --------------------------------------------------------------------
66 .OP \& "\%filespec \*(EL"
69 .BR "gperl -h" | --help
71 .BR "gperl -v" | --version
74 .\" --------------------------------------------------------------------
76 .\" --------------------------------------------------------------------
78 This is a preprocesor for
79 .BR \%groff (@MAN1EXT@).
89 can be stored in groff
92 .I numerical registers
93 based on the arguments at a final line of a
97 .\" --------------------------------------------------------------------
99 .\" --------------------------------------------------------------------
101 So far, there are only
110 are file names or the minus character
112 character for standard input.
114 As usual, the argument
116 can be used in order to let all fowllowing arguments mean file names,
117 even if the names begin with a minus character
124 when the program just writes the information that was asked for and
127 All other arguments will be ignored by that.
134 .B -h\~\fR|\fB\~--help
135 Print help information with a short explanation of options to
140 .B -v\~\fR|\fB\~--version
141 Print version information to standard output.
144 .\" --------------------------------------------------------------------
146 .\" --------------------------------------------------------------------
153 requests with different arguments, a
160 .\" --------------------------------------------------------------------
161 .SS "Starting Perl Mode"
162 .\" --------------------------------------------------------------------
166 can either be without arguments, or by a request that has the term
168 as its only argument.
177 .\" --------------------------------------------------------------------
178 .SS "Ending Perl Mode without Storage"
179 .\" --------------------------------------------------------------------
183 command line with an argument different from
188 Of course, it would be reasonable to add the argument
190 that's possible, but not necessary.
196 .BI \&.Perl " other_than_start"
201 can additionally be used as a
203 string variable name for storage \[em] see next section.
206 .\" --------------------------------------------------------------------
207 .SS "Ending Perl Mode with Storage"
208 .\" --------------------------------------------------------------------
212 is to store one or more results from the
219 can be got with backticks
224 This program collects all printing to STDOUT (normal standard output)
229 This pseudo-printing output can have several lines, due to printed
233 By that, the output of a Perl run should be stored into a Perl array,
234 with a single line for each array member.
238 This Perl array output can be stored by
243 by creating a groff command
247 .I groff number register
248 by creating a groff command
253 The storage modes can be determined by arguments of a final stopping
259 changes the mode into
263 changes the mode into
264 .I groff number register
265 for all following output parts.
269 By default, all output is saved as strings, so
271 is not really needed before the first
276 .BR \%groff (@MAN7EXT@),
277 because every output can be saved as
279 string, but the number registers can be very restrictive.
291 \&\fB.ds \fIvar_name content
296 .I number register mode
297 the following groff command is generated
300 \&\fB.nr \fIvar_name content
306 We present argument collections in the following.
308 You can add as first argument for all
311 We omit this additional element.
316 .BI ".Perl .ds " var_name
317 This will store 1 output line into the groff string named
319 by the automatically created command
323 .BI .ds " var_name output"
330 .BI .Perl " var_name"
335 this is equivalent to the former command, because the string mode is
343 .BI .Perl " var_name1 var_name2"
344 This will store 2 output lines into groff string names
348 because the default mode
350 is active, such that no
354 Of course, this is equivalent to
358 .BI ".Perl .ds " "var_name1 var_name2"
364 .BI ".Perl .ds " "var_name1 " ".ds" " var_name2"
371 .BI ".Perl .nr" " var_name1 varname2"
372 stores both variables as number register variables.
378 .BI .nr " var_name1 output_line1"
379 .BI .nr " var_name2 output_line2"
385 .BI ".Perl .nr " var_name1 " .ds " var_name2
386 stores the 1st argument as
393 .BI .nr " var_name1 output_line1"
394 .BI .ds " var_name2 output_line2"
399 .\" --------------------------------------------------------------------
400 .SS "Printing towards STDERR is without Storage"
401 .\" --------------------------------------------------------------------
405 (standard error) works as usual.
407 All error information goes to the real normal
408 .IR "standard error" ,
409 without other automatical storage.
412 .\" --------------------------------------------------------------------
414 .\" --------------------------------------------------------------------
420 could look like that:
425 my $result = 'some data';
427 \&.Perl stop .ds string_var
434 This stores the result
435 .B \[rq]some data\[rq]
440 such that the following line is printed:
443 \&.ds string_var some data
448 as food for the coming
456 with several outputs is:
460 print \[rq]first\[rs]n\[rq];
461 print \[rq]second line\[rs]n\[rq];
462 print \[rq]3\[rs]n\[rq];
463 \&.Perl var1 var2 .nr var3
467 This stores 3 printed lines into 3
470 .BR var1 , var2 , var3 .
474 command lines are created:
478 \&.ds var2 second line
484 .\" --------------------------------------------------------------------
486 .\" --------------------------------------------------------------------
489 Man\-pages related to
492 .BR \%groff (@MAN1EXT@),
493 .BR \%groff (@MAN7EXT@),
494 .BR \%grog (@MAN1EXT@),
496 .BR \%groffer (@MAN1EXT@).
503 .BR \%perl (@MAN1EXT@),
504 .BR \%perl (@MAN7EXT@).
507 .\" --------------------------------------------------------------------
509 .\" --------------------------------------------------------------------
511 .\" --------------------------------------------------------------------
513 .\" --------------------------------------------------------------------
517 .\" --------------------------------------------------------------------
519 .\" --------------------------------------------------------------------