go ahead... be a heretic | |
PerlMonks |
Re: Perl equivalent of C's #includeby athomason (Curate) |
on Aug 25, 2000 at 09:35 UTC ( [id://29583]=note: print w/replies, xml ) | Need Help?? |
Your problem is much more easily and cleanly solved by the above answers, so use those. This is just an academic comment ;-). <don't do this> Perl can actually use the C preprocessor if you invoke the interpreter with the -P flag. Then your #includes and other such C pragmas will work. However, as is typical for Perl, the kludgely preprocessor directives have been superceded by more Perlish (i.e., easier, safer, more huggable) constructs. #define constants should use the const module; #includes should be replaced by real modules with use or require. Since these aren't preprocessor directives, #ifdefs are unnecessary. </don't do this>
In Section
Seekers of Perl Wisdom
|
|