perl_edit
Edit files with Perl one-liners for advanced text modifications. Supports cross-platform file editing, backup creation, and multiline mode for efficient file updates without full replacements.
Instructions
Edit files using Perl one-liners (more powerful than sed, better cross-platform support)
Input Schema
Name | Required | Description | Default |
---|---|---|---|
backup | No | Create backup file | |
file | Yes | File to edit | |
multiline | No | Enable multiline mode (-0777) | |
script | Yes | Perl script (e.g., "s/old/new/g" or "$_ = uc" for uppercase) |
Input Schema (JSON Schema)
{
"properties": {
"backup": {
"default": true,
"description": "Create backup file",
"type": "boolean"
},
"file": {
"description": "File to edit",
"type": "string"
},
"multiline": {
"default": false,
"description": "Enable multiline mode (-0777)",
"type": "boolean"
},
"script": {
"description": "Perl script (e.g., \"s/old/new/g\" or \"$_ = uc\" for uppercase)",
"type": "string"
}
},
"required": [
"file",
"script"
],
"type": "object"
}