From linux at codehelp.co.uk Thu Jun 30 13:22:35 2005 From: linux at codehelp.co.uk (Neil Williams) Date: Thu, 30 Jun 2005 21:22:35 +0100 Subject: [DCPM] To quote or not to quote. Message-ID: <200506302122.38982.linux@codehelp.co.uk> I'm using Perl to parse some XML and generate C source code, including the Makefile.am, configure.in, autogen.sh, *.c, *.h and ChangeLog. http://qof-gen.sourceforge.net/ (currently only PHP on the public site, Perl code is in CVS) The code used as a template is also a live project: http://pilot-qof.sourceforge.net/ Naturally, I want to keep the code in the templates in sync with the code in the real project. However, I do NOT want to have to include placeholders in the REAL project. The places where the template uses modified strings are not predictable in a manner that would suit a regexp. Whilst some files are 100% generated, there are only small changes required to certain files - the name of the final program, copyright notices, names of the objects being used in the template - so I've got some files that are 10k of unchanged text with only maybe a dozen lines changing. I want to be able to update these sections with changes in the main project as easily as possible and that means I'd like to be able to simply cut and paste without worrying about enclosed quotation marks (single or double) or back/forward slashes. Currently, I have to watch the editor syntax highlighting carefully and manually escape any rogue characters. I can't use print < References: <200506302122.38982.linux@codehelp.co.uk> Message-ID: <20050630212540.GA20614@devon-it.co.uk> I've drunk a lot of wine, but I can identify this and will look into other bits tomorrow. Neil Williams wrote: > I can't use print < variable and is not printed immediately. $a = < Is it safe to use qq//; over multiple lines (using q$ $;maybe)? Yes. Steve