Mailing List Archive


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

Re: [tlug] Perl lists





On 8/9/2002, "Brett Robson" <brett@example.com> wrote:

>Got a quick question.
>
>Does anyone know a fast/easy way to append a fix value to each item in a
>list?
>
>eg I have a list of domains in @example.com and I want to put *. on the left
of
>each one. I'm currently uses a foreach.

I doubt you can get much faster or easier than for or foreach. But for
brevity, try

     @example.com = map { "*.$_" } @example.com;

Shimpei.


Home | Main Index | Thread Index

Home Page Mailing List Linux and Japan TLUG Members Links