1 .TH gperl @MAN1EXT@ "@MDATE@" "groff @VERSION@"
3 gperl \- execute Perl commands in
8 .\" ====================================================================
10 .\" ====================================================================
12 .\" Copyright (C) 2014-2020 Free Software Foundation, Inc.
14 .\" This file is part of gperl, which is part of groff, a free software
17 .\" You can redistribute it and/or modify it under the terms of the GNU
18 .\" General Public License as published by the Free Software Foundation,
21 .\" The license text is available in the internet at
22 .\" <http://www.gnu.org/licenses/gpl-2.0.html>.
25 .\" Save and disable compatibility mode (for, e.g., Solaris 10/11).
26 .do nr *groff_gperl_1_man_C \n[.cp]
29 .\" Define fallback for groff 1.23's MR macro if the system lacks it.
31 .if !\n(.f .nr do-fallback 1 \" mandoc
32 .if \n(.g .if !d MR .nr do-fallback 1 \" older groff
33 .if !\n(.g .nr do-fallback 1 \" non-groff *roff
34 .if \n[do-fallback] \{\
39 . IR \%\\$1 (\\$2)\\$3
45 .\" ====================================================================
47 .\" ====================================================================
69 .\" ====================================================================
71 .\" ====================================================================
73 This is a preprocessor for
84 can be stored in groff
87 .I numerical registers
88 based on the arguments at a final line of a
93 If no operands are given,
99 reads the standard input stream.
101 A double-dash argument
102 .RB (\[lq] \-\- \[rq])
103 causes all subsequent arguments to be interpreted as
106 even if their names start with a dash.
111 display a usage message,
116 display version information;
120 .\" ====================================================================
122 .\" ====================================================================
129 requests with different arguments, a
136 .\" ====================================================================
137 .SS "Starting Perl mode"
138 .\" ====================================================================
142 can either be without arguments, or by a request that has the term
144 as its only argument.
153 .\" ====================================================================
154 .SS "Ending Perl mode without storage"
155 .\" ====================================================================
159 command line with an argument different from
164 Of course, it would be reasonable to add the argument
166 that's possible, but not necessary.
172 .BI .Perl " other_than_start"
177 can additionally be used as a
179 string variable name for storage \(em see next section.
182 .\" ====================================================================
183 .SS "Ending Perl mode with storage"
184 .\" ====================================================================
188 is to store one or more results from the
195 can be got with backticks
200 This program collects all printing to STDOUT (normal standard output)
205 This pseudo-printing output can have several lines, due to printed
209 By that, the output of a Perl run should be stored into a Perl array,
210 with a single line for each array member.
214 This Perl array output can be stored by
219 by creating a groff command
224 by creating a groff command
229 The storage modes can be determined by arguments of a final stopping
235 changes the mode into
239 changes the mode into
241 for all following output parts.
247 By default, all output is saved as strings, so
249 is not really needed before the first
254 .MR groff @MAN7EXT@ ,
255 because every output can be saved as
257 string, but the registers can be very restrictive.
269 .BI .ds " var_name content"
275 the following groff command is generated
278 .BI .nr " var_name content"
284 We present argument collections in the following.
286 You can add as first argument for all
289 We omit this additional element.
294 .BI ".Perl .ds " var_name
295 This will store 1 output line into the groff string named
297 by the automatically created command
301 .BI .ds " var_name output"
308 .BI .Perl " var_name"
313 this is equivalent to the former command, because the string mode is
321 .BI .Perl " var_name1 var_name2"
322 This will store 2 output lines into groff string names
326 because the default mode
328 is active, such that no
332 Of course, this is equivalent to
336 .BI ".Perl .ds " "var_name1 var_name2"
342 .BI ".Perl .ds " "var_name1 " ".ds" " var_name2"
349 .BI ".Perl .nr" " var_name1 varname2"
350 stores both variables as register variables.
356 .BI .nr " var_name1 output_line1"
357 .BI .nr " var_name2 output_line2"
363 .BI ".Perl .nr " var_name1 " .ds " var_name2
364 stores the 1st argument as
371 .BI .nr " var_name1 output_line1"
372 .BI .ds " var_name2 output_line2"
377 .\" ====================================================================
379 .\" ====================================================================
385 could look like that:
390 my $result = \[aq]some data\[aq];
392 \&.Perl stop .ds string_var
399 This stores the result
405 such that the following line is printed:
408 \&.ds string_var some data
413 as food for the coming
421 with several outputs is:
425 print \(rqfirst\(rsn\(rq;
426 print \(rqsecond line\(rsn\(rq;
427 print \(rq3\(rsn\(rq;
428 \&.Perl var1 var2 .nr var3
432 This stores 3 printed lines into 3
435 .BR var1 , var2 , var3 .
439 command lines are created:
443 \&.ds var2 second line
449 .\" ====================================================================
451 .\" ====================================================================
455 .MT groff\-bernd\:.warken\-72@\:web\:.de
460 .\" ====================================================================
462 .\" ====================================================================
468 .MR groff @MAN1EXT@ ,
469 .MR groff @MAN7EXT@ ,
482 .\" Restore compatibility mode (for, e.g., Solaris 10/11).
483 .cp \n[*groff_gperl_1_man_C]
484 .do rr *groff_gperl_1_man_C
491 .\" vim: set filetype=groff textwidth=72: