From owner-freebsd-questions Tue Nov 19 14:11:46 2002 Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 5084037B404 for ; Tue, 19 Nov 2002 14:11:45 -0800 (PST) Received: from kallisti.mine.nu (h24-70-180-74.wp.shawcable.net [24.70.180.74]) by mx1.FreeBSD.org (Postfix) with SMTP id 8986643E3B for ; Tue, 19 Nov 2002 14:11:43 -0800 (PST) (envelope-from catseye@kallisti.mine.nu) Received: (qmail 1577 invoked by uid 1001); 19 Nov 2002 22:07:57 -0000 Date: Tue, 19 Nov 2002 16:07:56 -0600 From: Chris Pressey To: Scott Pilz Cc: freebsd-questions@FreeBSD.ORG Subject: Re: Syslog Piping Message-Id: <20021119160756.0f25b6e8.cpressey@catseye.mb.ca> In-Reply-To: <20021119153526.M30438-100000@mail.tznet.com> References: <20021119153526.M30438-100000@mail.tznet.com> Organization: Cat's Eye Technologies, http://www.catseye.mb.ca/ X-Mailer: Sylpheed version 0.8.6 (GTK+ 1.2.10; i386-portbld-freebsd4.7) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit 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 Tue, 19 Nov 2002 15:39:24 -0600 (CST) Scott Pilz wrote: > > In syslog, if you have: > > *.* | /pipe.pl > > The output should be piped to pipe.pl - how, in perl, would you go about > capturing this output? I have tried everything I could think of. $1, > ARGV[#], STDIN, while (<>) (which apparently works on linux, I haven't > tried myself), and then some. > > Anybody ever try this? > > Thanks, > > Scott IIRC you might need to put $| = 1; at the beginning of the Perl script, so that STDIN is automatically flushed. -Chris To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message