Mailing List Archive


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

Re: [tlug] OT: interesting NY times article:High-Tech Japanese, Running Out of Engineers



2008/5/26 Curt Sampson <cjs@example.com>:
> On 2008-05-26 12:05 +0900 (Mon), Josh Glover wrote:
>
>> for my $nationality (@nationalities) {
>>     my $newPremise =  $premise;
>>     $newPremise      =~ s/Japanese/$nationality/;
>>     print "$newPremise\n";
>> }
>
> Ewww.
>
> nationalities.each { |n| puts premise.sub('Japanese', n) }

Hey, Perl can do that in one line too!

print join("\n", map { ($a = $premise) =~ s/Japanese/$_/; $a; } @nationalities);

;)


Ian Barwick


Home | Main Index | Thread Index

Home Page Mailing List Linux and Japan TLUG Members Links