my @player_rec = split /\|/; if (scalar(@player_rec) == scalar(@fields)) { if ($sth->execute(@player_rec)) { print "Worked, cool"; } else { print "Didn't work, uncool, error is: $DBI::errstr"; } } else { warn "incorrect number of fields at line $.\n"; warn sprintf("expected: %d but found %d\n",scalar(@fields), scalar(@player_rec)); }