Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re: C pre-processor in Perl

by perrin (Chancellor)
on Jul 28, 2003 at 19:16 UTC ( #278570=note: print w/replies, xml ) Need Help??


in reply to C pre-processor in Perl

Well, constant is lame and should be avoided, so I'd certainly prefer a #define there. I doubt it has any significant speed or memory advantages though. It just lets you avoid the syntax traps of the constant pragma. The #include one seems like a bad idea. If you include that code in more than one place, it will take up more memory. You will also lose the dependency tracking that require gives you.

Also, note that you can do this with a source filter by using the Filter::cpp module.

UPDATE: Why not just use the -P option, instead of a source filter? Well, you mentioned mod_perl. Environments that use a persistent interpreter will often not allow you to do command-line options like -P.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://278570]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others chanting in the Monastery: (3)
As of 2021-05-15 02:58 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Perl 7 will be out ...





    Results (150 votes). Check out past polls.

    Notices?