Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!usc!elroy.jpl.nasa.gov!decwrl!pa.dec.com!shlump.nac.dec.com!decvax.DEC.COM!evans From: evans@decvax.DEC.COM (Marc Evans) Newsgroups: comp.lang.perl Subject: Re: Perl & cpp Keywords: perl -P option, redundancy, cpp Message-ID: <21914@shlump.nac.dec.com> Date: 9 Apr 91 11:46:29 GMT References: <5685@taux01.nsc.com> Sender: news@shlump.nac.dec.com Reply-To: evans@decvax.DEC.COM Organization: Synergytics Lines: 29 In article <5685@taux01.nsc.com>, arielf@taux01.nsc.com (Ariel Faigon) writes: |> The -P (preprocess perl using cpp) perl option is seldom used. |> I wonder what Larry had in mind when he introduced it. |> Was it that "creeping featurism" ideal ;-) Really? I use it in a large number of the perl scripts I have... |> [...] |> (has anyone used it ? what for ?). Probably the most common way that I use it is: # include "getopts.pl" or something simular. Even #defines are handy for macros that expand into perl code, as oposed to using perl functions or eval. I use #define in simular cases as where I would in regular C or C++ programming. Yes, it would have been more useful to have a -Dfoo[=bar] and -Ufoo ability, but there are ways to deal with that. Judicious use of #if* in an appropriate *commonly* included file has served its purpose for my needs. - Marc -- =========================================================================== Marc Evans - WB1GRH - evans@decvax.DEC.COM | Synergytics (603)635-8876 Unix and X Software Consultant | 21 Hinds Ln, Pelham, NH 03076 ===========================================================================