iperl - bring any text documents alive with bits of embedded Perl
iperl[ option|file] ...
[
|
]
Options may be repeated and are processed in the order specified. This means that while processing a file, all options encountered further left are applied. Multiword option-names may be separated by an underscore instead of a dash.
If present, the environment variable $IPERL is processed as though the parameters in it were given at the beginning of the command-line. No Shell syntax is parsed, except that it is split on spaces.
$IPERL
The vitamins -- ahem! -- options -C, -d, -D, -E, -I, -o and -U are like in the C compiler or m4 macro processor.
-C
-d
-D
-E
-I
-o
-U
Revert to autostyle-detection.
Set style useful among others for typical Unix files, i.e. comment-lines begin with #, lines of Perl begin with !, !{...}! is for bits of Perl, !<...>! for printing bits of Perl and an optional leading & for macro invocations.
#
!
!{...}!
!<...>!
&
If flag is 1 cache all files given on the command line or in include directives, such that they are not reread and recompiled when included again.
1
Without flag do not discard comments. If flag is 2, discard even if there is whitespace before or after the comment. If it is 3, discard all comments.
Set style based on control characters, i.e. lines of Perl begin with ^A, ^B...^E is for bits of Perl and ^P...^E for printing bits of Perl.
^A
^B...^E
^P...^E
Output the generated intermediate programme, rather than executing it.
Define macro as definition or as 1 if none.
Evaluate expr as a Perl programme.
Set style as in C preprocessor, i.e. lines of Perl begin with # and defined macros have no syntactic sugar.
Same as a file argument without option. This is useful when file starts with a -.
-
Defines a simple style. Takes 5 regexps delimited by any character, / here. The style swallows anything that matches comment. Anything between print and printend is a printing bit of Perl, while anything between perl and perlend is simple Perl.
/
Allows directly providing a document on the commandline. The variable @documents contains the string '<COMMANDLINE>' in this case.
@documents
'<COMMANDLINE>'
Appends to the list of directories where include first searches for files not found in the current directory.
include
Set style as in m4 preprocessor, i.e. perl({...}) is for bits of Perl, perl(<...>) for printing bits of Perl and many m4-macros are available.
perl({...})
perl(<...>)
Redirect output for the following documents to file, which may be any valid argument to open for output. An initial > is however optional.
open
>
When reading from stdin, a pipe or an --include-string document, the output is directed to a file named stdin.out, pipe.out or include-string.out. A number n is added before the dot and then incremented when in the same invocation another pipe or --include-string document is encountered, regardless whether such a file already exists.
--include-string
When reading from a normal file, the output is directed to a file named similarly. If the filename has a suffix other than p[hlms], pdb, p[bgnp]m, php, php[1-4] or [ch]pp starting or else ending with a p that letter is eliminated. Otherwise .out is appended.
p[hlms]
pdb
p[bgnp]m
php
php[1-4]
[ch]pp
p
.out
This option remains in effect until given again or an option --output overrides it.
--output
If flag is 1 remove any pod from document. Else if flag is not present or 0 set style suitable for pod, i.e. paragraphs of Perl start with =for perl or are surrounded by =begin perl and =end perl, within paragraphs P<{...}> is for bits of Perl, P<...> for printing bits of Perl and defined macros are called as M<macro> or M<macro( arg, ... )>.
0
=for perl
=begin perl
=end perl
P<{...}>
P<...>
M<macro>
M<macro( arg, ... )>
Set style suitable for SGML based languages such as HTML or XML. Bits of Perl are embedded in <perl>...</perl> or <server>...</server> or <script runat=server>...</script>. Printing bits of Perl (entities) are &<...>; or `...` and macro entities are ¯o; or ¯o( arg, ... );.
<perl>...</perl>
<server>...</server>
<script runat=server>...</script>
&<...>;
`...`
¯o;
¯o( arg, ... );
Trace macro when it will be defined.
An argument file may be any valid argument to open for input. If no file is given, nor an -f or -i option, standard input is read.
-f
-i
This is the commandline frontend of an inverse Perl interpreter, where normal text gets printed as is, while Perl statements have to be specially marked as such. Loop or conditional blocks can surround normal text.
If no style is explicitly set, it is automatically determined from either an Emacs kind of local variables specification for iPerl-style, or the file-name if any, or by looking at the document-contents for constructs specific to some style.
iPerl-style
Text::iPerl, web-iPerl, iPerl.el, perl, http://beam.to/iPerl/
To install Text::iPerl, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Text::iPerl
CPAN shell
perl -MCPAN -e shell install Text::iPerl
For more information on module installation, please visit the detailed CPAN module installation guide.