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!
In reply to Re: Match/Replace/Interpolate
by Corion
in thread Match/Replace/Interpolate
by toadi
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |