Run Perl command for each line
Example
Normal 0 / 2Command-line 1 / 2Normal 2 / 2red
blue
greenCursor on line 1, column 1red
blue
greenCursor on line 1, column 1RED
BLUE
greenCursor on line 1, column 1Run Perl command for each line.
Per-line context
- Range
1,2- Input lines
red / blue
Command entered · ready to apply
Per-line context
- Range
1,2- Input lines
red / blue
Perl receives each line in $_; assigning $_ changes the line. The final true value permits the update. Only lines 1–2 are transformed; line 3 is outside the range.
Per-line context
- Range
1,2- Completed
RED / BLUE
Before & after
red
blue
greenCursor on line 1, column 1Per-line context
- Range
1,2- Input lines
red / blue
RED
BLUE
greenCursor on line 1, column 1Per-line context
- Range
1,2- Completed
RED / BLUE
Subject: :perldo. Documentation-backed illustration; assumes +perl and Perl; unrestricted Vim; modifiable buffer outside sandbox; not replay-verified. Perl receives each line in $_; assigning $_ changes the line. The final true value permits the update. Only lines 1–2 are transformed; line 3 is outside the range.
Details & Vim help
Run Perl command for each line. This Ex reference uses the full command name; the alphabetical index omits arguments. Supply the ranges, arguments, flags and prerequisite state documented in the linked help. Press Enter to submit a complete command. The index spelling :perld[o] puts the optional abbreviation suffix in square brackets; those brackets are not typed. Availability and exact behavior can depend on Vim build features, options, mappings and editor state; the linked help is authoritative. This command requires a Vim build with +perl support and compatible runtime libraries for the documented embedded language interface.