I'm pretty new to Perl and have the following issue: I'm trying to replace a version number in a .yml
file with a different value. This is what my regex looks like:
version:\s*([^\s]+)
It works so far, but it does not do what I like it to do.
Here the code that I currently have, and the Perl statement to replace the value in the .yml
file.
file content(./test.yml):
app:
version: 1.2
name: abc
code:
$search = "version:\s*([^\s]+)";
$replace = '1.3';
perl -pie 's/$search/$replace/m' ./test.yml;
Any help would be greatly appreciated!