[lug] perl question

j davis davis_compz at hotmail.com
Sat Apr 27 14:27:37 MDT 2002


Hi,

i know i should be adressing this question to a perl group but they
would proably flame me. So Ill ask my fellow blug members.
I have a array that came from sucking in addresses from a text file
like this....

snip..

Dr. Stephen Abel
5 Ellen Court
Orinda, CA 94563
Deanmail#

William J (Jr.) Abraham
11137 E Mariola Way
Scottsdale, AZ
85262-3203
furlow#

Jack Abrams
#2 Fran Avenue
Trenton, NJ 08638-1402
Kippenbach#

Mathew Abrams
Accetra Art Ltd.
240 Madison Avenue
Grdn City Pk, NY 11040
Misc#

...snip


the last line with the # is there artist prefrence. Ant way because this
list came from a word perfect 5.1 label list i had to convert it and do all 
kind of wierd stuff with perl to get it where it is now. However
when i do

foreach $arry (@array){
        print "$array\n";
}

i get that

$array[0] =  Dr. Stephen Abel
             5 Ellen Court
             Orinda, CA 94563
             Deanmail#

$array[1] = William J (Jr.) Abraham
            11137 E Mariola Way
            Scottsdale, AZ
            85262-3203
            furlow#

and so on... this happens because of some split stuff i did in the script 
that put the list in its current format. Im ok with this...
i just want to know how i can get each line from say..$array[0]
into another array so each line is a diffrent var..like

$newarray[o] = William (jr) abrham
$newarray[1] = 11137 e Mariola way

and so on....this way i can add a"#" to the begging of $newarray[0]
so ms word will be cool when i mailmerg this list so word can make mailing 
labes...and so i can easily pattern match against users first names on 
returned mail.

Please Help,

jd




_________________________________________________________________
MSN Photos is the easiest way to share and print your photos: 
http://photos.msn.com/support/worldwide.aspx




More information about the LUG mailing list