From owner-freebsd-questions Mon Feb 4 7:55:50 2002 Delivered-To: freebsd-questions@freebsd.org Received: from newman.ucs.mun.ca (newman.ucs.mun.ca [134.153.2.130]) by hub.freebsd.org (Postfix) with ESMTP id E085137B434 for ; Mon, 4 Feb 2002 07:55:41 -0800 (PST) Received: from plato.ucs.mun.ca (root@plato.ucs.mun.ca [134.153.2.151]) by newman.ucs.mun.ca (8.12.1/8.12.1) with ESMTP id g14FtWW7025757; Mon, 4 Feb 2002 12:25:32 -0330 (NST) Received: from plato.ucs.mun.ca (pdf@localhost [127.0.0.1]) by plato.ucs.mun.ca (8.12.1/8.12.1) with ESMTP id g14FtWtX014054; Mon, 4 Feb 2002 12:25:32 -0330 (NST) Received: (from pdf@localhost) by plato.ucs.mun.ca (8.12.1/8.12.1/Submit) id g14FtVSU004141; Mon, 4 Feb 2002 12:25:31 -0330 (NST) From: Paul David Fardy Message-Id: <200202041555.g14FtVSU004141@plato.ucs.mun.ca> To: cjclark@alum.mit.edu Cc: questions@FreeBSD.org Subject: Re: Perl question... In-reply-to: Your message of "Fri, 01 Feb 2002 15:22:07 PST." <20020201152207.C956@gohan.cjclark.org> Reply-To: pdf@mun.ca Date: Mon, 04 Feb 2002 12:25:30 -0330 Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On Fri, Feb 01, 2002 at 05:24:46PM -0330, Paul David Fardy wrote: >> I've been using Perl so much, I've forgotten some of my shell rules. >> I tested this code because I thought "$TTL" would result in the >> expansion of an undefined variable TTL. In Perl, it _would_ be a >> problem. In sh, it's fine. Your message dated: Fri, 01 Feb 2002 15:22:07 PST > It is not expanded because I quoted "EOF" as the here-doc > delimiter. If I had not, it would have been. >> ed $file <<"EOF" Yeah, I realize that (now). I was just noting the re-wiring of my brain to follow Perl's rules wherein the expansion of a here-doc is enabled by <<"EOF" and disabled by <<'EOF' This should probably have been just my "note-to-self". But I figure it has enough educational value under the subject ("Perl question") that others might learn from it. 1) Perl and the shells have a useful feature called "here documents"; 2) one needs to be careful about the expansion of variables within a here-doc (irrespective of which language you use); and 3) the Perl and shell rules for here docs differ in significant ways. Paul To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message