in reply to Re^2: 2*pi*$r -- constant function without prototype
in thread 2*pi*$r -- constant function without prototype
I recently needed the line feed ("\012") as constant (Note: "\n" is platform dependent!).
Compare:
The speed penalty for Readonly is not meaningful in my case. However if you have large calculations which only dependent on constants, maybe inside a loop, then use constant is better because perl can optimise it at compile time.use Readonly; Readonly $NL => "\012"; [...] print FILE "header1${NL}header2${NL}"; use constant NL => "\012"; [...] print FILE "header1" . NL . "header2" . NL;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: 2*pi*$r -- constant function without prototype
by BrowserUk (Patriarch) on May 01, 2008 at 13:53 UTC | |
by parv (Parson) on May 01, 2008 at 22:57 UTC |