in reply to Re: How can I replace a single character (digit) in a file
in thread How can I replace a single character (digit) in a file
Pretty close to what you updated to. It took me a while to realize I shouldn't be using the 8 char read.open THIS_FILE, "+<$listOption" or die "ERROR: SearchFile: $!"; while (<THIS_FILE>) { if (/^$genre\t\d$/) { seek(THIS_FILE, -2, 1) or die; print THIS_FILE $option; seek(THIS_FILE, 1, 1) or die; } } close THIS_FILE;
Thanx
-Zach (SFSC)
|
|---|