in reply to find and replace counter
hi try this
use strict; my $cnt=0; while(<DATA>){ $_ =~s/<xxx>/++$cnt.$&/gie; print $_; } __DATA__ <xxx>...</xxx> <p>...</p> <xxx>...</xxx><xxx>...</xxx> <p>...</p>
Regards
Balaji. M
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: find and replace counter
by hipowls (Curate) on Jan 08, 2008 at 07:20 UTC | |
|
Re^2: find and replace counter
by texuser74 (Monk) on Jan 08, 2008 at 07:11 UTC |