From owner-freebsd-questions@FreeBSD.ORG Mon Dec 16 20:30:24 2013 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7F365BE7 for ; Mon, 16 Dec 2013 20:30:24 +0000 (UTC) Received: from mail.unitedinsong.com.au (mail.unitedinsong.com.au [150.101.178.33]) (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 38133192C for ; Mon, 16 Dec 2013 20:30:23 +0000 (UTC) Received: from laptop2.herveybayaustralia.com.au (laptop2.herveybayaustralia.com.au [192.168.0.100]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by mail.unitedinsong.com.au (Postfix) with ESMTPSA id 46F712735C for ; Tue, 17 Dec 2013 06:23:01 +1000 (EST) Message-ID: <52AF6125.3010500@herveybayaustralia.com.au> Date: Tue, 17 Dec 2013 06:23:01 +1000 From: Da Rock User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:17.0) Gecko/20130516 Thunderbird/17.0.6 MIME-Version: 1.0 To: freebsd-questions@freebsd.org Subject: Perl unable to open named pipe Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Dec 2013 20:30:24 -0000 Little left field, but I cannot seem to make this work and it would appear to be peculiar to FreeBSD (although I have no means to test this on another system atm); I'm trying to write a small script of a larger project that uses named pipes for IPC and perl strangely cannot open them. This basically what my script is doing - it is pretty much this short: #!/usr/bin/perl use strict; use warnings; use diagnostics; use POSIX qw(mkfifo); if (!open(HANDLE, "<", FIFO)) { if (mkfifo(FIFO)) { print "FIFO created\n"; open(HANDLE, "<", FIFO); } else { die "couldn't create FIFO"; } else { } The script literally hangs when open is called. Diagnostics gives no clue to what could be the issue. I've tried unless instead of if (so die can be called and an error can be printed). And I've put messages in to see where it gets to in the script, and that confirms the position of the stall. I've also tried on an ordinary text file - it works, but just not FIFO! Any clues? Cheers