in reply to map question
@numbers = (6,210, 3); # not necessarly consecutive $templ="test X number "; print join "\n", map{($str = $templ)=~s/X/$_/?$str:undef}(@numbers);
just remember that map is chief among the ob-fu master's tools. Use it wisely, and only after considering a for loop or foreach loop, or you may be writing some code that'll come back to haunt you.
|
|---|