Mailing List Archive


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

Re: [tlug] Perl lists



>
> 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'd have to see your code but let me try to guess how you'd do it:

@example.com = ( 'blorf.com', 'fungo.org', 'nerps.net' );

for (my $x = 0; $x < scalar @example.com; $x++)
{
$domains[$x] = '*.' . $domains[$x];
}

that's one possible way i think.

Home | Main Index | Thread Index

Home Page Mailing List Linux and Japan TLUG Members Links