From owner-freebsd-questions Tue Nov 19 14:13:50 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 3A26C37B401 for ; Tue, 19 Nov 2002 14:13:48 -0800 (PST) Received: from squid.tznet.com (squid.tznet.com [66.170.64.7]) by mx1.FreeBSD.org (Postfix) with ESMTP id 8F6FF43E42 for ; Tue, 19 Nov 2002 14:13:47 -0800 (PST) (envelope-from tech@tznet.com) Received: from mail.tznet.com (mail.tznet.com [66.170.64.2]) by squid.tznet.com (8.12.3/8.12.5) with ESMTP id gAJMDjek020290; Tue, 19 Nov 2002 16:13:45 -0600 (CST) Date: Tue, 19 Nov 2002 16:13:45 -0600 (CST) From: Scott Pilz To: paul beard Cc: questions Subject: Re: Syslog Piping In-Reply-To: <3DDAB64B.8050201@mac.com> Message-ID: <20021119161316.U50599-100000@mail.tznet.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII T-NetSMTP: Virus Check - Found to be clean 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 Tried that - but found the problem. Picky picky picky :)... needed a "./pipe.pl".. I should have known better. Guess I got used to /bins. Thanks. On Tue, 19 Nov 2002, paul beard wrote: > 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