in reply to Problem changing only first occurence of pattern in file
You're looping more than you mean to. I think you want to pare your code down to just:
my $flag = 0; local ($^I, @ARGV) = (".bak", "/var/ww/htdocs/cgi-bin/user.txt"); while (<>) { $flag = 1 if !$flag and s/\|No$/|Yes/; print; }
|
---|
In Section
Seekers of Perl Wisdom