GOODE, J.
Action on the statute to recover double the value of two mules hilled by a locomotive of the defendant company. The complaint, among other things, avers as follows:
*142“That said mules came upon the track of said railroad and were killed in said township at a point Avhere said railroad passes through and along inclosed and cultivated fields and uninclosed lands and where defendant was required by law to erect and maintain lawful fences on the side of its said road with openings and gates therein, and where there was not any crossing of said road by a public highway and not within the limits of any incorporated city, town or village; that defendant on said 8th day of August, 1903, and for a long time prior thereto failed and neglected to keep and maintain along the sides of its said railroad at the point where said mules got upon the track as aforesaid and were killed, lawful fences with openings and gates therein hung and having latches or hooks so that the same might be easily opened and shut at necessary farm crossings of the road, and that by reason of said neglect and failure on the part of the defendant, the plaintiff’s said mules got upon said railroad track and were struck and killed and the killing of said mules was occasioned then and there by reason of the neglect and failure aforesaid on the part of the defendant.”
The railroad company was shown by the testimony of the plaintiff himself to have a good fence at the place where the mules entered the right of way; but there was a gate in the fence there and some testimony tended to prove the gate had a fastening which was out of order, and other testimony to prove the gate was left open for long periods. That the fastening worked well and was in perfect repair was also supported by testimony. One witness swore he saw the gate open on Saturday before the mules were killed on Sunday and again on Sunday during the day; and on Sunday night he found the bodies of the mules near the track. Plaintiff’s land did not adjoin the right of way but was separated from it by a neighbor’s farm. Several lines of fence ran between the inclosure in which he kept his mules and the rail*143road track. On this fact the defendant raises the proposition that plaintiff is not entitled to recover even if the'right of way was imperfectly inclosed. There would be merit in this contention if the private fences intervening between the plaintiff’s inclosure and the right of way, had been lawful fences and sufficient to turn stock; but they had been more or less swept away by floods, so that stock could easily pass through the fields of plaintiff’s neighbor Avhose farm adjoined the right of way. We understand the law to* be that a farmer whose land does not join a railroad right of way, cannot recover damages from the railroad company if an animal of his gets on the track by reason of defective railway fences along the right of way and is killed, provided there is a lawful private fence between his land and the railway. That is to say, a laAvful intervening fence on the lands. of the proprietor adjacent to the railroad. In such instances the private fence takes the place of a fence along the right of Avay, so far as the non-adjacent proprietor is concerned. But if no lawful fence intervenes either along the right of way or elsewhere, and an animal belonging to an owner of land not adjacent to the railway goes across intervening lands to the track and is killed, an action for damages on the statute lies. This is the law as maintained by numerous cases. [Berry v. R. R., 65 Mo. 172; Harrington v. Id., 71 Mo. 384; Reinhard v. Id., 80 S. W. 910; Phillips v. Id., 107 Mo. App. 203, 80 S. W. 926.] In the cases cited Missouri authorities bearing op. the question are collated and we think they all declare the rule as stated except Feriss v. R. R., 30 Mo. App. 132. Remarks are made in that case which look inconsistent with the other decisions; but it would support the right of the present plaintiff to recover. In the Feriss case the animal killed went on the track neither from lands contiguous to the right of way nor lands next back, but passed across the farm of several intervening proprietors — in fact had traveled four miles before reaching the railroad. On this state of facts a recovery *144was denied. But it was said the adjoining owner may waive a fence on that part of his land next to a railroad, in which event his other fences stand as railroad fences, and the owner next adjoining may have a cause of action against the railroad if such fences are insufficient. That statement of the law covers the present case. As the plaintiff’s mules crossed his neighbor’s fields through fences which had been partly demolished and then went on the railroad track through a defective fence, or through a gate which the railroad company had negligently left open, the plaintiff had a cause of action on the statute for double damag’es.
It will be observed from the quoted portion of the complaint, that the plaintiff did not count on the negligence of the defendant in leaving the gate open; but on its failure to keep and maintain lawful fences and gates as required by the statutes. Most of the evidence went to show the mules got on the track through an open gate, and that the gate being open was the proximate cause of the accident. No objection was interposed to the reception of this evidence, and the defendant met it with counter evidence to show the railway company was careful to keep the gate closed. The court instructed the jury that if they believed the gate in question was open and the mules went through it, and that it had been standing open for such a length of time that the defendant knew or ought to have known the fact, and have closed it before the mules went through, then the failure to close the gate was negligence on the part of the defendant and the verdict should be for the plaintiff. This instruction was given against the defendant’s objection. We grant that negligently letting a gate in a right of way fence remain open constitutes a violation of the statute requiring lawful fences to be maintained, and entitles a party whose animal is killed in consequence of having passed through the open gate to double damages. But the question presented in this case is one of pleading and is as to *145the right of the plaintiff, who complained only of a defective or improperly constructed gate and fence, to have a verdict on account of the negligence' of the railroad company, not in suffering a gate or fence to he out of order, but in letting a gate stand open an unreasonable length of time. We examined this question in Stonebraker v. Chicago, etc., R. R., 10 Mo. App. 497, and held that a complaint for not fencing or for having a defective fence, states no cause of action for leaving a gate open. It was decided in Atchison, etc., R. R. v. Kavanaugh, 163 Mo. 54, 63 S. W. 374, that if an animal goes on a railroad track in consequence of a gate being left open, the construction of the gate, whether good or bad, is not the proximate cause of the accident; but the proximate cause is leaving the gate open. Hence, as a plaintiff in a tort case must charge a defendant with the specific omission of duty on which a verdict is expected, this defendant’s negligence in permitting the gate to stand open should have been declared on in the complaint. _ J_> u. U l/llV V/Dvn U XlCtlTO XIXD.VJLW ________ L dxKtil case in one important particular. In the latter case the railway company objected to evidence to prove it negligently left the gate open through which Stonebraker’s animal entered the right of way; whereas, in this case such evidence went in without objection. Testimony was introduced by the defendant on the question and both parties treated it as an essential issue of fact to be tried as the pleadings stood. We are, therefore, confronted with the question whether, under these circumstances, the court was justified in submitting the issue to a jury by an instruction. This is a proposition on which the decisions in this State are conflicting and we have been perplexed about it frequently. In Price v. Railroad, 72 Mo. 514, it was ruled that though evidence irrelevant to the pleadings is received without objection, the court is not warranted in giving instructions which permit the jury to find a verdict on that evidence. The *146same ruling was declared in Safety, etc., Bank v. Westlake, 21 Mo. App. 565 and Matson v. Frazer, 48 Mo. App. 302. The opposite view was taken in Mellor v. Railroad, 105 Mo. 455, 16 S. W. 849; Obouquette v. Id., 152 Mo. 257, 53 S. W. 897; Turner v. Id., 51 Mo. 501; Stewart v. Goodrich, 9 Mo. App. 125; Madison v. Railroad, 60 Mo. App. 599. In Mellor v. Railroad, supra, the subject received close attention and was decided by the Supreme Court In Banc, the cause having been certified to the full bench because there was a difference of opinion among the judges of one division on the proposition. The action was for personal injuries. The petition contained no allegation of loss of earnings but evidence to prove the plaintiff had suffered a loss of earnings on account of his injuries was given without an objection from the defendant. ' An objection was interposed to the court’s instructing the jury so as to authorize an award of damages for loss of earnings, for the reason that the petition was silent on the subject. It -was decided that loss of earnings must be specially pleaded to let in evidence of that species of injury over a defendant’s objection, and is not embraced in a general allegation of damages. But the main question was whether, evidence having been received of the plaintiff’s loss, an instruction based on that evidence was proper. It was ruled that the evidence at most constituted a variance from the petition and not a failure to prove the cause of action in its entire scope and meaning, and as its admission was unopposed, the defendant waived the defect in the pleading. The general ground of this and the other decisions holding the same view is, that if an objection to irrelevant evidence is interposed the courtmay order the pleading amended; and if no objection is offered, it will be taken for granted that the non-objecting party waived the defect in his adversary’s pleading. In Obouquette v. Railroad, an action for damages for an injury sustained by the plaintiff as a passenger on a street car, the petition charged that she was thrown off *147the car in a scramble of the passengers to escape from a live electric wire which threatened their lives. The evidence showed the plaintiff, instead Of being thrown off, went to the platform and jumped off, and a verdict was given on that evidence. It was held that the evidence should have been objected to when offered, so the petition could have been amended to' conform to the facts pleaded. In Fisher, etc., Co. v. Realty. Co., 159 Mo. 562, it was said that though a party cannot declare on one cause of action and recover on another, it is equally well settled that (quoting from the opinion) “timely and. appropriate objection must be made to the introduction of the evidence offered on the distinct ground of variance between the allegata and probata and that the objecting party must proceed in the manner provided by section 2096, Revised Statutes 1889, otherwise his objection will not be considered. And the affidavit setting forth in what respect a party has been misled is the sole test of the materiality of a discrepancy between allegata and probata. If a party fails to avail himself of section 2096, supra, in the trial court, it is too late to complain in the appellate court.” The opinion in that case cites with approval Briggs v. Munchon, 56 Mo, 467; Ridenhour v. Railroad, 102 Mo. 270, 13 S. W. 889, 14 S. W. 760; Mellor v. Railroad, 105 Mo. 455, 16 S. W. 849; Bank v. Leyser, 116 Mo. 51, 22 S. W. 504, and other cases declaring the same rule. This is the latest decision on the point under discussion we have found. There are others which hold that a party cannot declare on one cause of action and get judgment on another. All of these are not easy to reconcile with those, we have noticed. [Raming v. Railroad, 157 Mo, 477, 57 S. W. 268.] In some instances the divergence of the evidence from the pleadings is treated as a variance and in others as a failure of proof, though the divergence may be no greater in the one case than in the other. But generally the principle is recognized that a verdict is allowable if there is nothing more than a variance, but not when there is a total failure of *148.proof. In Madison v. Railroad, supra, the plaintiff was hurt by the overturning of a wagonload of hay on account of a badly constructed railroad crossing. The answer was a general denial. An instruction for the defendant was refused which precluded a recovery provided the jury found the section foreman had offered to make the crossing* secure if the plaintiff would let him know when he intended to drive over it, but the plaintiff drove over it without informing the section foreman. This instruction was refused on the ground that it was outside the defense pleaded in the answer; but as evidence had been admitted in support of the defense without objection, the appellate court ruled the trial court should have instructed on it. The ruling was that as the plaintiff had not objected to the evidence, he waived the insufficiency of the answer as a basis for it. The statutes say no variance between the allegations of a pleading and the proof shall be deemed material unless it has actually misled the adverse party to his prejudice ; and the fact that it has misled him must be shown by affidavit; whereupon the court may order the pleading to be amended upon such terms as shall be just. [R. S. 1899, sec. 655.] Another section provides that when an immaterial variance occurs, the trial court may direct the -facts to be found according to the evidence, or may order an immediate amendment without costs. [R. S. 1899, sec. 656.] Those statutes warrant an instruction to a jury to find a verdict on evidence irrelevant to the pleadings, unless the party objecting pursues the statutory steps to avoid that result, and the court thereupon finds he will be prejudiced by the evidence. But the statutes provide that where the cause of action or the defense, to which the proof is directed, is unproved, not in some particulars, but in its entire scope pf meaning, this shall be deemed a failure of proof, not a variance. [Section 798, R. S. 1899.] In our judgment the proper disposition of the question under consideration depends on whether merely showing the gate was negligently left *149open by the defendant, Avithout proof of some other omission of duty, Avould constitute a total failure to prove the cause of action stated in plaintiff’s complaint, or only a failure to establish some particulars of the cause of action; that is, that it occurred, as alleged in the complaint, on account of a defective gate or fence. Therefore, Ave must inquire Avhat the cause of action is. The meaning of the phrase “cause of action” is not so Avell settled that it is used always in the same sense or with a precise understanding of its significance in the modern codes. Each of several counts in a petition is called a separate cause of action, even when, properly speaking, they all state the same cause of action in different ways to meet the facts as they may be developed on the trial. In such instances there is only one cause of action in the true meaning of the term, and a general verdict is good; Avkereas, if there were several distinct causes of action it would not be. [Campbell v. King, 32 Mo. App. 38; Brownell v. Railroad, 47 Mo. 238; Owens v. Railroad, 58 Mo. 394.] Various definitions of “cause of action” are collected in the notes to Pomeroy’s Code Procedure (4 Ed.), p. 459, sec. 346, et seq. The author says, in substance, that the term signifies a plaintiff’s primary right and the defendant’s wrongful violation of that right. This elucidation is the outcome of much thought and analysis of the authorities and looks sound. We are not driven to a comprehensive definition in order to decide the point of immediate moment, but are concerned to know only Avhether proving an animal went through a railway gate, left open in violation of a statute, shows a cause of action so distinct from one stated in charging that the animal went through a defective gate or fence, as to amount to a failure to- prove the latter cause in its entire scope and meaning. If the complaint had stated the facts one Avay in one count and the other way in the second count, it is plain that a general verdict could be upheld according to the cases cited above. One cause of action would have been stated in *150different ways to meet possible disclosures of facts, by the evidence. The plaintiff’s primary and fundamental right, which the defendant violated, was to have the railroad track inclosed by a lawful fence and gate, so his stock could not gO' on the track. That right could be infringed either by not maintaining a good fence and gate, or carelessly letting the gate stand open. The gist of the cause of action was the defendant’s failure to obey the statute, and the consequent loss of plaintiff’s mules by collision with an engine. To prove defendant’s disobedience consisted in leaving a gate open instead of, as the complaint charged, failure to construct and maintain a lawful fence and gate, was to fall short .of proving the cause of action stated in one particular, but not in its entire scope and meaning. This constituted a variance and not a failure of proof; and by the very words of the statutes, the court might deal with it in either of two ways as justice demanded: If the defendant claimed to be misled and satisfied the court of the fact, an amendment of plaintiff’s pleading on terms was proper (section 655) ; if the variance was found to be immaterial the court’s duty was to direct the jury to find the facts according to the evidence or order an amendment without costs (section 656). Now, instead of claiming surprise, and that they had been misled, by the variance between the plaintiff’s pleading and his proof, the counsel for the railway company offered no objection, but introduced counter testimony to meet the irrelevant testimony introduced by the plaintiff. The court directed the jury to find the facts according to the evidence, as the statutes authorized, and we know of no principle by which it can be said that course was erroneous. It is argued that the instruction about the open gate was objected to and the overruling of this objection was error. But as the defendant had failed to raise the question of variance in the statutory way, and had let irrelevant evidence go in without objection, the court was bound to submit it to the jury’s consideration, either by *151directing a finding in accordance with, it without an amendment, or after ordering an amendment. No effort was made to have the evidence regarding the open gate withdrawn from the jury by an instruction and all the defendant did was to object to all the instructions asked by the plaintiff. Such objections are often formal and do not serve to call a court’s attention to the fact that the party is opposing an instruction because it is founded on evidence not germane to the pleadings. If the complaint had been amended after the proof was in, the question would be beyond controversy. How can it be said the defendant was prejudiced by failure to-amend in view of the fact that it never contested the reception of evidence outside the issues tendered by the complaint, but put in evidence on the same subject? On the whole we think no reversible error occurred in authorizing a verdict if the defendant negligently left the gate open. Other sections of the statutes appear to recommend this ruling. It is provided that no judgment shall be reversed by reason of any defect in the pleadings not affecting the substantial rights of the adverse party (sec. 659); that no verdict shall be reversed for an omitted averment without proof of which the triers of the fact ought not to have given the verdict (sec.672) ; and that errors not materially affecting the merits shall be no cause to reverse a judgment (sec. 865). As the defendant in this case introduced testimony to disprove the testimony for the plaintiff that the gate through which plaintiff’s mules passed was negligently left open, and tried the case without complaint, on the theory that the matter of the open gate was in issue, it is difficult to see how it was prejudiced by the court’s instructing on that issue, or how we can reverse the judgment because the court so instructed, without disregarding the statutes cited. The judgment is affirmed.
All concur.