in reply to Import constants as scalar instead of bareword sub
I don't understand your objection to "bareword subs". Perl understands them perfectly well if they are defined before they're called.
In practice, it's pretty rare that constants need to be interpolated, except maybe when debugging with print.
You can make $EINTR a constant with:
but that kind of thing is not always portable between systems. Because the value must be a reference to a literal in source, afaik that would require some kind of source filter to get portability. Not worth it, IMO.*EINTR = \4;
After Compline,
Zaxo
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Import constants as scalar instead of bareword sub
by perrin (Chancellor) on Nov 02, 2005 at 19:41 UTC | |
|
Re^2: Import constants as scalar instead of bareword sub
by xdg (Monsignor) on Nov 02, 2005 at 22:22 UTC | |
|
Re^2: Import constants as scalar instead of bareword sub
by itub (Priest) on Nov 02, 2005 at 20:50 UTC | |
by powerman (Friar) on Nov 02, 2005 at 21:29 UTC | |
|
Re^2: Import constants as scalar instead of bareword sub
by sauoq (Abbot) on Nov 03, 2005 at 02:44 UTC | |
|
Re^2: Import constants as scalar instead of bareword sub
by powerman (Friar) on Nov 02, 2005 at 21:47 UTC |