note
rjt
<p>I believe this will do what you are looking for:</p>
<c>while (<DATA>) {
chomp;
my ($s, $a, $c, $r) = split /[,\t]/;
die "Invalid string: $_" if !defined $r;
print "Processing: $_\n";
}
__DATA__
clientserver,00001,AIT,SOURCE
clientserve|00001|AIT|SOURCE</c>
<p><b>Output:</b></p>
<c>Processing: clientserver,00001,AIT,SOURCE
Invalid string: clientserve|00001|AIT|SOURCE at 1006854.pl line 6, <DATA> line 2.</c>
<p>Just change the <c>die</c> and <c>print</c> lines to do what you actually need.</p>
1006854
1006854