From owner-freebsd-chat Mon Apr 17 17:24:54 2000 Delivered-To: freebsd-chat@freebsd.org Received: from mail.rz.fh-wilhelmshaven.de (mail.rz.fh-wilhelmshaven.de [139.13.25.134]) by hub.freebsd.org (Postfix) with ESMTP id 0235D37B64F for ; Mon, 17 Apr 2000 17:24:46 -0700 (PDT) (envelope-from ohoyer@fbwi.fh-wilhelmshaven.de) Received: from fettesau.stuwo.fh-wilhelmshaven.de (stuwopc5.stuwo.fh-wilhelmshaven.de [139.13.209.5]) by mail.rz.fh-wilhelmshaven.de (8.9.3/8.9.3) with SMTP id CAA25458 for ; Tue, 18 Apr 2000 02:24:40 +0200 (MET DST) Message-Id: <4.1.19990225010419.009bed10@mail.rz.fh-wilhelmshaven.de> X-Sender: ohoyer@mail.rz.fh-wilhelmshaven.de X-Mailer: QUALCOMM Windows Eudora Pro Version 4.1 Date: Thu, 25 Feb 1999 01:23:19 +0100 To: freebsd-chat@freebsd.org From: Olaf Hoyer Subject: Re: Un*x scripting magic In-Reply-To: Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Sender: owner-freebsd-chat@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org At 18:56 17.04.00 -0500, you wrote: >Hi all, > >A have a chunk of perl code something like this. > > # insert bunch of code here > > my $msg <%%MESSAGE%% >EndOfMessage > > # more code goes here > >Then I have a multi-line (printable characters only) ASCII >text file containing the message that I'd like to replace >for %%MESSAGE%%. [1] Anyone have a neat little trick in >their bag-o-magic? I know the answer should be really >obvious but everything I've tried thus either hasn't worked >or was too convoluted. > Hi! Well, from my limited Java experience (begun courses this year) two ideas came to mind: Is it possible to read it in from a text file, or defined in the beginning of the source code, or a dedicated subroutine? Then I'd put this into a string or array long enough to handle that, perhaps even split it into several substrings of its too long... Regards Olaf Hoyer -------- Olaf Hoyer www.nightfire.de mailto:Olaf.Hoyer@nightfire.de FreeBSD- Turning PC's into workstations ICQ:22838075 Liebe und Hass sind nicht blind, aber geblendet vom Feuer, dass sie selber mit sich tragen. (Nietzsche) To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-chat" in the body of the message