in reply to REGEX with input file

The problem is not obvious, both duff and Roger have invetigated, and they are experienced. It has to be something else. Why don't you debug more yourself under your very own environment, with your real data. Here I gave you something to start with: (code has only been syntax checked with -c)

my $newUser ='dummy'; while(<SETORA>) { print "read from file: [$_]\n"; if (/O_PREFIX=/) { print "regexp matched\n"; s/O_PREFIX=\w+/O_PREFIX=$newUser/; print "after s, [$_]\n"; print outputfile } }

I don't think your data really match the regexp's you have.