in reply to Problem changing only first occurence of pattern in file
Please give your questions meaningful titles.
You're probably better off using Tie::File for something like this.
use Tie::File; tie my @file, 'Tie::File', 'user.txt'; for (@file) { s/\|No$/|Yes/ and last; }
"The first rule of Perl club is you do not talk about
Perl club."
-- Chip Salzenberg
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Problem changing only first occurence of pattern in file
by jwkrahn (Abbot) on Oct 17, 2006 at 17:48 UTC |