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

Re: [MacPerl] Question - Substitution



> At 15.47 -0500 1998.12.23, Mark Manning/Muniz Eng. wrote:
>>                @theInfo =~ s/\s$theName\s/ <a
>>href="c$j.html">$theName<\/a> /g;
>
> You cannot do that.  In this case, @theInfo will be taken as in scalar
> context, so you are really doing:
>
>   scalar(@theInfo) =~ s/MATCH/REPLACEMENT/g;
> And you cannot substitute on that value.

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;

Best wishes,

Lindsay

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