On Oct 6, Nath, Alok (STSD) said:
Here's a simple script that is suppose to read a file and
changes a particular string.
Opening a file for read/write doesn't mean you can do in-place edits just
like that. If you want to do simple in-place editing, here's an example:
{
local
Hi,
Here's a simple script that is suppose to read a file and
changes a particular string.
sub ChangeVMConfFile{
open(DATA, "+){
if ($_ =~m/Ethernet0.connectionType/){
$_ =~
s/Ethernet0.connectionType/Ethernet0.connectionType_changed/g ;