perlivp
Verify installed Perl modules and versions
SYNOPSIS
While 'perlivp' is not a command, its components refer to perl options.
perl [-OPTION_FLAGS] [--long-option] [-e 'command'] [scriptfile] [arguments...]
Specifically, when -v is present:
perl [-...] -v [-...]
Prints perl version and exits.
PARAMETERS
-p
Enables an implicit loop around the program, similar to sed. It iterates over lines of input, executing the program block for each line, and automatically prints each line after processing.
-l
Activates automatic line-ending processing. It chomps the input record separator ($INPUT_RECORD_SEPARATOR) from input and appends the output record separator ($OUTPUT_RECORD_SEPARATOR) to any output.
-i [EXTENSION]
Enables in-place editing of files. A backup of the original file is created with EXTENSION (e.g., .bak) if provided, otherwise the original is overwritten.
-v
Prints the version and patchlevel of the perl interpreter and then exits immediately.
DESCRIPTION
The string 'perlivp' does not represent a standalone Linux command. Instead, it is a sequence of common command-line options often used with the perl interpreter: -p, -l, -i, and -v.
While each of these options provides powerful functionality, their combination as 'perlivp' results in a specific interaction: the -v (version) option causes perl to print its version information and then immediately exit. This behavior overrides and prevents the execution of any script or processing implied by -p (loop through lines), -l (chomp/newline handling), or -i (in-place editing).
Therefore, executing perl -p -l -i -v (or any order including -v) will only display the perl version and nothing more. Users typically combine -p, -l, and -i without -v for powerful one-liner text processing.
CAVEATS
The most significant caveat when combining -v with other options like -p, -l, or -i is that perl -v takes precedence. It will print the version and exit, ignoring any other options or script logic intended for text processing or in-place editing. Therefore, 'perlivp' as a functional combination for text processing is ineffective due to the immediate exit caused by -v.
COMMON <B>PERL</B> ONE-LINER PATTERNS
While 'perlivp' is non-functional as a whole, the combination of -p, -l, and -i (without -v) is extremely common for powerful text processing.
Examples:
perl -pli.bak -e 's/foo/bar/g' file.txt
Replaces all occurrences of 'foo' with 'bar' in 'file.txt', creating 'file.txt.bak' as a backup.
perl -pl -e 'print reverse $_' file.txt
Reverses each line in 'file.txt' and prints it to standard output.
These examples demonstrate the utility of these options when correctly combined for various text manipulation tasks.
HISTORY
The perl programming language, created by Larry Wall, first appeared in 1987. It was designed as a general-purpose Unix scripting language to make report processing easier. Many of its command-line options, including -p, -l, and -i, were inspired by utilities like sed and awk, allowing perl to be used effectively for one-liner text manipulation directly from the shell. The -v option is a standard convention across many Unix commands for version information, and its behavior of causing an immediate exit is also common to provide quick version checks without running full program logic.