True, unless you get rid of the while entirely. The first paragraph of s/// documentation reads: (Emphasis mine)
Searches a string for a pattern, and if found, replaces that pattern with the replacement text and returns the number of substitutions made.
So you get
my $post_body = ...from db...; my $match = s/.../.../ig;
By the way, I don't think $match should be singular. $matches is better but not nearly as descriptive as something like $num_blks.
In reply to Re^5: perlmonks downloadable code blocks
by ikegami
in thread perlmonks downloadable code blocks
by debiandude
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |