Alright, so a couple of days ago I find out it is now my job to write a module for Webmin, in Perl, of which I have not written a single line of code.
My goal is opening a file, changing a value, and then saving the file back to the server. I know about the rights I need to issue to the file and how to open a file and how to save.
What I don't know is how to find my way around the opened file, how to change what I want, and pull out.
Here is one of several files I want to edit, not all of them are xml.
<?xml version="1.0" encoding="UTF-8"?>
<targets>
<target path="/foo/bar">
<configuration>
<size>512</size>
</configuration>
</target>
</targets>
How can I edit just those three characters "512"? The solution will hopefully be universal because I need to apply it over several different configuration files...
My goal is opening a file, changing a value, and then saving the file back to the server. I know about the rights I need to issue to the file and how to open a file and how to save.
What I don't know is how to find my way around the opened file, how to change what I want, and pull out.
Here is one of several files I want to edit, not all of them are xml.
<?xml version="1.0" encoding="UTF-8"?>
<targets>
<target path="/foo/bar">
<configuration>
<size>512</size>
</configuration>
</target>
</targets>
How can I edit just those three characters "512"? The solution will hopefully be universal because I need to apply it over several different configuration files...