Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Re: C pre-processor in Perl

by perrin (Chancellor)
on Jul 28, 2003 at 19:16 UTC ( [id://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
Domain Nodelet?
Node Status?
node history
Node Type: note [id://278570]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others pondering the Monastery: (3)
As of 2024-04-25 07:02 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found