adjohan has asked for the wisdom of the Perl Monks concerning the following question:
I was expecting the substitution to be recompile everytime and new val is used. But not in thise case... why?$foo = "some sentence x"; $val = 1; while ($val < 5) { $foo =~ s/x/$val/; print "$val $foo\n"; $val++; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: substitution not recompile
by ikegami (Patriarch) on Mar 24, 2005 at 15:11 UTC | |
|
Re: substitution not recompile
by polettix (Vicar) on Mar 24, 2005 at 15:14 UTC | |
by manav (Scribe) on Mar 24, 2005 at 15:30 UTC |