in reply to Re: PDL and srand puzzle
in thread PDL and srand puzzle
I guess that the call to sqrt gets compiled to CORE::sqrt before the interpreter processes your subroutine declaration. You can get the warning about the ambiguity if you declare your subroutine before calling sqrt (I got rid of the percent format because it breaks shell syntax on Linux):
That prints:perl -wle "sub sqrt { return q(more than 1.4) } print sqrt(2);print ma +in::sqrt(2); print CORE::sqrt(2);"
Ambiguous call resolved as CORE::sqrt(), qualify as such or use & at - +e line 1. 1.4142135623731 more than 1.4 1.4142135623731
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^3: PDL and srand puzzle
by syphilis (Archbishop) on Jun 05, 2024 at 07:49 UTC |