in reply to Re: PDL and srand puzzle
in thread PDL and srand puzzle
The CORE namespace take priority. This is important because otherwise you would end up in situations like you have with PDL's srand all the time. If you want to override the core function you can do it like this:
perl -wle "use subs 'sqrt'; print sqrt(2); print CORE::sqrt(2); sub sq +rt { return sprintf('%.6g',$_[0] ** 0.5) } " 1.41421 1.4142135623731
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: PDL and srand puzzle
by syphilis (Archbishop) on Jun 05, 2024 at 08:10 UTC | |
by sectokia (Friar) on Jun 06, 2024 at 00:40 UTC | |
by syphilis (Archbishop) on Jun 06, 2024 at 02:31 UTC |