From owner-freebsd-questions@FreeBSD.ORG Fri Mar 27 20:35:34 2009 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AD16F106566B for ; Fri, 27 Mar 2009 20:35:34 +0000 (UTC) (envelope-from joost@jodocus.org) Received: from viefep16-int.chello.at (viefep16-int.chello.at [62.179.121.36]) by mx1.freebsd.org (Postfix) with ESMTP id 056858FC0A for ; Fri, 27 Mar 2009 20:35:33 +0000 (UTC) (envelope-from joost@jodocus.org) Received: from edge04.upc.biz ([192.168.13.239]) by viefep18-int.chello.at (InterMail vM.7.09.01.00 201-2219-108-20080618) with ESMTP id <20090327202006.IEPW28039.viefep18-int.chello.at@edge04.upc.biz>; Fri, 27 Mar 2009 21:20:06 +0100 Received: from bps.jodocus.org ([77.248.200.61]) by edge04.upc.biz with edge id YLKt1b0251Kyz9104LKuwQ; Fri, 27 Mar 2009 21:20:06 +0100 X-SourceIP: 77.248.200.61 Received: from jodocus.org (localhost [IPv6:::1]) by bps.jodocus.org (8.14.2/8.14.2) with ESMTP id n2RKJr6c042156; Fri, 27 Mar 2009 21:19:53 +0100 (CET) (envelope-from joost@jodocus.org) Received: from 192.168.100.227 (SquirrelMail authenticated user joost) by jodocus.org with HTTP; Fri, 27 Mar 2009 21:19:53 +0100 (CET) Message-ID: <1772.192.168.100.227.1238185193.squirrel@jodocus.org> In-Reply-To: <20090327185912.GA77908@sushi.pseudo.local> References: <20090326212045.GB3134@sushi.pseudo.local> <20090326221128.3a6d648f@gluon.draftnet> <20090327185912.GA77908@sushi.pseudo.local> Date: Fri, 27 Mar 2009 21:19:53 +0100 (CET) From: "Joost Bekkers" To: "Tobias Rehbein" User-Agent: SquirrelMail/1.4.13 MIME-Version: 1.0 Content-Type: text/plain;charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Priority: 3 (Normal) Importance: Normal X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.0.1 (bps.jodocus.org [IPv6:::1]); Fri, 27 Mar 2009 21:19:53 +0100 (CET) Cc: freebsd-questions@freebsd.org Subject: Re: [perl] sysopen(CD, "/dev/cd0", O_RDONLY | O_NONBLOCK) fails X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Mar 2009 20:35:35 -0000 On Fri, March 27, 2009 19:59, Tobias Rehbein wrote: > Am Thu, Mar 26, 2009 at 10:11:28PM +0000 schrieb Bruce Cran: >> > Hm. Tried this and got ineresting results: > >> use POSIX; >> sysopen(CD,"/dev/cd0", O_RDONLY|O_NONBLOCK) || perror("sysopen") > works fine, but >> use POSIX; >> sysopen(CD,"/dev/cd0", O_RDONLY|O_NONBLOCK) >> print "$!" > prints "No such file or directory" > > Well, I think I'll have to accept that sysopen works but $! does not... > After > all sysopen is more important to me ;) As the perlvar manpage tells us: $! If used numerically, yields the current value of the C "errno" variable, or in other words, if a system or library call fails, it sets this variable. This means that the value of $! is meaningful only immediately after a failure. The value of $! is NOT an indicator of success or failure. It only tells you why something failed. If something succeeded $! is usualy left untouched. Joost.