From owner-freebsd-questions Tue Nov 19 14: 8:17 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 80B6237B401 for ; Tue, 19 Nov 2002 14:08:15 -0800 (PST) Received: from smtpout.mac.com (A17-250-248-87.apple.com [17.250.248.87]) by mx1.FreeBSD.org (Postfix) with ESMTP id 2702843EAA for ; Tue, 19 Nov 2002 14:08:15 -0800 (PST) (envelope-from paulbeard@mac.com) Received: from asmtp01.mac.com (asmtp01-qfe3 [10.13.10.65]) by smtpout.mac.com (Xserve/MantshX 2.0) with ESMTP id gAJM8Ecd011769 for ; Tue, 19 Nov 2002 14:08:14 -0800 (PST) Received: from mac.com ([12.231.115.57]) by asmtp01.mac.com (Netscape Messaging Server 4.15) with ESMTP id H5UG5Q00.IY5; Tue, 19 Nov 2002 14:08:14 -0800 Message-ID: <3DDAB64B.8050201@mac.com> Date: Tue, 19 Nov 2002 14:08:11 -0800 From: paul beard User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.2b) Gecko/20021116 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Scott Pilz , questions Subject: Re: Syslog Piping References: <20021119153526.M30438-100000@mail.tznet.com> In-Reply-To: <20021119153526.M30438-100000@mail.tznet.com> Content-Type: text/plain; charset=us-ascii; format=flowed 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 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 (<>) while (<>) { code } should work. It's not a linuxism. here's a sample: [/home/paul]:: more test.pl #!/usr/bin/env perl while (<>) { print $_; } Now just pipe something thru it: [/home/paul]:: cat .signature | test.pl Paul Beard / 8040 27th Ave NE / Seattle WA 98115 / paulbeard [at] mac [ dot] com / 206 529 8400 weblog @ I'm rated PG-34!! -- Paul Beard / 8040 27th Ave NE / Seattle WA 98115 / paulbeard [at] mac [ dot] com / 206 529 8400 weblog @ I'm rated PG-34!! To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message