Trying to step through the array until one of the first elements in the array is matched then replace that line with new data.
Madaxe
Madaxe
Code:
open (PLAYERLIST3, "$perpicklist");
@userlist3 = <PLAYERLIST3>;
close (PLAYERLIST3);
foreach $moddata (@userlist3) {
chomp $moddata;
($weekno, $playerpick) = split(/\|/, $moddata);
if ("$weekno" eq "$week_pick") {
open (PLAYERLIST3, "$perpicklist");
print FILE "$week_pick\|$player_pick\n";
close (PLAYERLIST3);
}
}