[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

Re: [MacPerl] Question - Substitution



>But to actually provide a solution, I'd suggest you use map...
>
>	map {s/\s$theName\s/ <a href="c$j.html">$theName<\/a> /g} @theInfo;

Then again, you might want to use a for loop:

for (@theInfo) { [put your substitution here] }

AFAIK, the difference between map and for in this case is that map creates
a temporary array for the return value, and for has no return value.  I
remember there being some religious discussion in the newsgroup about this
issue (when to use for vs. map).

-- Gene

***** Want to unsubscribe from this list?
***** Send mail with body "unsubscribe" to mac-perl-request@iis.ee.ethz.ch