in reply to Re: comparing elements of two arrays
in thread comparing elements of two arrays

My arrays are strings. Each elements is one line from a file. This is how I read the data and insert it into 2 arrays:
$infile1 = "sept13.csv"; $infile2 = "sept14.csv"; open (infile1); @array1=<infile1>; close(infile1); open (infile2); @array2=<infile2>; close(infile2);
The format of file(.csv) is as follows. Last Name, First Name, WebCT ID, Password, Courses Calvert,Aaron,aacalvert,0120015,lib101 Accardo,Andrea,aaccardo,0110659,biol361h:cost280h:lib100

Replies are listed 'Best First'.
Re: Re: Re: comparing elements of two arrays
by mrbbking (Hermit) on Dec 25, 2001 at 02:19 UTC
    Slurping the whole file in like that results in a one-element array. So there is nothing at subscript 2 to compare.

    You'll need to split the lines of each file into their component parts before you can compare (what appears to be) usernames.

    ...does that make sense?