Hello,
I am trying to pick up Array's in perl. I have a simple function, open a text file that has multiple line and 4 field. I am pushing the file into an array then printing the value of $state from each line into another file. When I tried this my Print line keeps giving me error.
Thanks For all ur help.
DATAFILE:
MI,Detroit,CASS,Jack
CO,Denver,DPS,Linda
CODE:
open (USERUPDATELIST, $usrfile) || &open_error($usrfile);
while (<USERUPDATELIST>) {
($state,$district,$school,$username) = split (/,/, $, 4);
push( @UpdateUSRList, join("," ($state,$district,$school,$username)));
}
close (USERUPDATELIST);
for my $i (0..$#UpdateUSRList) {
open (MYPAGEDATA, ">$mypage" || &open_error($mypage);
print (MYPAGEDATA "$UpdateUSRList[$i][$state]"
close (MYPAGEDATA);
}
I am trying to pick up Array's in perl. I have a simple function, open a text file that has multiple line and 4 field. I am pushing the file into an array then printing the value of $state from each line into another file. When I tried this my Print line keeps giving me error.
Thanks For all ur help.
DATAFILE:
MI,Detroit,CASS,Jack
CO,Denver,DPS,Linda
CODE:
open (USERUPDATELIST, $usrfile) || &open_error($usrfile);
while (<USERUPDATELIST>) {
($state,$district,$school,$username) = split (/,/, $, 4);
push( @UpdateUSRList, join("," ($state,$district,$school,$username)));
}
close (USERUPDATELIST);
for my $i (0..$#UpdateUSRList) {
open (MYPAGEDATA, ">$mypage" || &open_error($mypage);
print (MYPAGEDATA "$UpdateUSRList[$i][$state]"
close (MYPAGEDATA);
}