I voted you up for that response ... I started re-writing it
anyway. But what I was really lookin for was something
like this (but a perl solution):
#ifndef HAPPY
#define HAPPY
The code that may have already been included elsewhere.
#endif
| [reply] [d/l] |
In that case you would probably want to use eval to run test perl code that would run correctly if your library's function was loaded, otherwise it would bomb. Eval will trap the bomb, and allow you to decide wether or not to lode the library. However, I'd follow Adam's advice :) .
Caio,
Gryn
| [reply] |
You can use the c precompiler with perl. (-P)
Or you could put a similar check in the BEGIN block of you package, along with some wizardry to get out of the package from the BEGIN block... maybe a goto or something. (I wouldn't die or exit there, and returning would just get you out of the BEGIN block, not the package.)
| [reply] |
| [reply] |