I have next script:
package T;
use strict;
use warnings;
sub fn1 {
my( $var1, $var2 ) = @_;
T::fn2 $var1, $var2;
}
sub fn2 {
print ">>@_<<"; # >>x1<<
}
package main;
use strict;
use warnings;
T::fn1 'x1', 'x2'; # >>x1<<
Here T::fn2 is called with two arguments but it get only one parameter.
I understand that I call forward subroutine which is not visible at time of parsing and is counted as bareword.
But I have use strict, use warnings so I expect warning is issued or program should not work at all instead it works incorrectly.
So Why it is still working and T::fn2 is called actually with one argument?
perl version is 5.30.3