Perl: Difference between revisions
From wikinotes
No edit summary |
No edit summary |
||
Line 1: | Line 1: | ||
An interpreted language. | |||
Latest revision as of 21:11, 18 June 2022
An interpreted language.
Perl Interpreter
Perl doesn't use an interpreter quite like python, but there is a debug prompt which lets you use it that way:
perl -de 1 #start interpreter DB<1> print "hello world" #example print command hello world DB<2>
Multiline Search/Replace
# Replace `Gradient "Nose"` and the 2x lines following it # with `Gradient "Head" perl -0777 -pe 's/Gradient "Nose".*\n.*\n.*/Gradient "Head"/g' myfile.txt