in reply to Match/Replace/Interpolate
I'd do the whole search-and-replace thing in one step instead of two steps:
$line =~ s!<gid=(\d+)>!<img src="PATH/TO/$1">!g;
I think the only problem with your approach is that it lacked the /g "global" modifier that replaces all occurrences within one line.
20060721 shmem spotted a missing > sign, thanks!
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Match/Replace/Interpolate
by toadi (Chaplain) on Jul 21, 2006 at 08:58 UTC | |
by Corion (Patriarch) on Jul 21, 2006 at 09:01 UTC | |
by gellyfish (Monsignor) on Jul 21, 2006 at 09:01 UTC |