1 .TH GPERL @MAN1EXT@ "@MDATE@" "groff @VERSION@"
3 gperl \- groff preprocessor for Perl parts in roff files
5 .\" ====================================================================
7 .\" ====================================================================
9 .\" Copyright (C) 2014-2018 Free Software Foundation, Inc.
11 .\" This file is part of gperl, which is part of groff, a free software
14 .\" You can redistribute it and/or modify it under the terms of the GNU
15 .\" General Public License as published by the Free Software Foundation,
18 .\" The license text is available in the internet at
19 .\" <http://www.gnu.org/licenses/gpl-2.0.html>.
21 .\" ====================================================================
23 .\" ====================================================================
26 .ie t .ds EL \fS\N'188'\fP\"
27 .el .ds EL \&.\|.\|.\&\"
33 .\" used in '.IP \*(BU 2m' (former .Topic)
36 .\" ====================================================================
38 .\" ====================================================================
58 .\" ====================================================================
60 .\" ====================================================================
62 This is a preprocessor for
63 .BR \%groff (@MAN1EXT@).
73 can be stored in groff
76 .I numerical registers
77 based on the arguments at a final line of a
81 .\" ====================================================================
83 .\" ====================================================================
85 So far, there are only
94 are file names or the minus character
96 character for standard input.
98 As usual, the argument
100 can be used in order to let all following arguments mean file names,
101 even if the names begin with a minus character
108 when the program just writes the information that was asked for and
111 All other arguments will be ignored by that.
118 .B \-h\~\fR|\fB\~\-\-help
119 Print help information with a short explanation of options to
124 .B \-v\~\fR|\fB\~\-\-version
125 Print version information to standard output.
128 .\" ====================================================================
130 .\" ====================================================================
137 requests with different arguments, a
144 .\" ====================================================================
145 .SS "Starting Perl Mode"
146 .\" ====================================================================
150 can either be without arguments, or by a request that has the term
152 as its only argument.
161 .\" ====================================================================
162 .SS "Ending Perl Mode without Storage"
163 .\" ====================================================================
167 command line with an argument different from
172 Of course, it would be reasonable to add the argument
174 that's possible, but not necessary.
180 .BI .Perl " other_than_start"
185 can additionally be used as a
187 string variable name for storage \(em see next section.
190 .\" ====================================================================
191 .SS "Ending Perl Mode with Storage"
192 .\" ====================================================================
196 is to store one or more results from the
203 can be got with backticks
208 This program collects all printing to STDOUT (normal standard output)
213 This pseudo-printing output can have several lines, due to printed
217 By that, the output of a Perl run should be stored into a Perl array,
218 with a single line for each array member.
222 This Perl array output can be stored by
227 by creating a groff command
231 .I groff number register
232 by creating a groff command
237 The storage modes can be determined by arguments of a final stopping
243 changes the mode into
247 changes the mode into
248 .I groff number register
249 for all following output parts.
253 By default, all output is saved as strings, so
255 is not really needed before the first
260 .BR \%groff (@MAN7EXT@),
261 because every output can be saved as
263 string, but the number registers can be very restrictive.
275 .BI .ds " var_name content"
280 .I number register mode
281 the following groff command is generated
284 .BI .nr " var_name content"
290 We present argument collections in the following.
292 You can add as first argument for all
295 We omit this additional element.
300 .BI ".Perl .ds " var_name
301 This will store 1 output line into the groff string named
303 by the automatically created command
307 .BI .ds " var_name output"
314 .BI .Perl " var_name"
319 this is equivalent to the former command, because the string mode is
327 .BI .Perl " var_name1 var_name2"
328 This will store 2 output lines into groff string names
332 because the default mode
334 is active, such that no
338 Of course, this is equivalent to
342 .BI ".Perl .ds " "var_name1 var_name2"
348 .BI ".Perl .ds " "var_name1 " ".ds" " var_name2"
355 .BI ".Perl .nr" " var_name1 varname2"
356 stores both variables as number register variables.
362 .BI .nr " var_name1 output_line1"
363 .BI .nr " var_name2 output_line2"
369 .BI ".Perl .nr " var_name1 " .ds " var_name2
370 stores the 1st argument as
377 .BI .nr " var_name1 output_line1"
378 .BI .ds " var_name2 output_line2"
383 .\" ====================================================================
384 .SS "Printing towards STDERR is without Storage"
385 .\" ====================================================================
389 (standard error) works as usual.
391 All error information goes to the real normal
392 .IR "standard error" ,
393 without other automatic storage.
396 .\" ====================================================================
398 .\" ====================================================================
404 could look like that:
409 my $result = 'some data';
411 \&.Perl stop .ds string_var
418 This stores the result
424 such that the following line is printed:
427 \&.ds string_var some data
432 as food for the coming
440 with several outputs is:
444 print \(rqfirst\(rsn\(rq;
445 print \(rqsecond line\(rsn\(rq;
446 print \(rq3\(rsn\(rq;
447 \&.Perl var1 var2 .nr var3
451 This stores 3 printed lines into 3
454 .BR var1 , var2 , var3 .
458 command lines are created:
462 \&.ds var2 second line
468 .\" ====================================================================
470 .\" ====================================================================
473 .MT groff\-bernd.warken\-72@\:web.de
478 .\" ====================================================================
480 .\" ====================================================================
486 .BR \%groff (@MAN1EXT@),
487 .BR \%groff (@MAN7EXT@),
488 .BR \%grog (@MAN1EXT@),
490 .BR \%groffer (@MAN1EXT@).
497 .BR \%perl (@MAN1EXT@),
498 .BR \%perl (@MAN7EXT@).
501 .\" ====================================================================
503 .\" ====================================================================
508 .\" vim: set filetype=groff: