Hello Monks!
I am building a little graphical tool to search and replace strings in text files in an interactive manner.
For the replace function, I would like the ability to capture substrings in order to reuse them in the replace string. So far I did not find a way to use the $1 when it is not hardcoded.
This would be an example of user input :
$string1='sometext(.*)something(.*)';
$string2='$1:$2';
This would be the replace statement.
$mystring =~ s/$string1/$string2/g;
I have tried a couple of ways but I don't seem to be able to find a right way.
Maybe I missed something very basic or maybe I should use some module to do this.
I am pretty new to Perl so I will not be annoyed if I am directed to a piece of documentation :D
Can please someone advise?
Thanks Zylot