in reply to amateur at Perl need helpwith small script
open(UPD, "<$data_file") or die "Cannot open $data_file (5Z)."; flock UPD,2; seek(UPD,0,0); @upd = <UPD>; close(UPD); chomp(@upd); foreach $line (@upd) { ($d_line) = split (/\n/, $line);
You are reading a text file into the array @upd and then you chomp the array which removes all newlines ("\n").
Inside the foreach loop you try to split the current line on newlines which do not exist because you have already removed them.
|
|---|