develooper Front page | perl.perl5.porters | Postings from April 2000

[ID 20000418.001] open bug

Thread Next
From:
Norman.Azadian
Date:
April 18, 2000 04:16
Subject:
[ID 20000418.001] open bug
Message ID:
FA9B854C1708D411A54500508B027BE9CC182C@gdr038.swissptt.ch
If the first characters of an open filename specification are whitespace,
the open fails without yielding a failure status.  As I understand the first
two sentences of the 2nd paragraph on page 191 of the camel book, this
should not be the case.  Here's a small program to illustrate the problem:

	#!/usr/bin/perl -w
	#Illustrates a perl bug
	#According to the second paragraph on page 191 of the bible, leading
	#whitespace should not be a problem.  Here it is shown to be.

	open OUTPUT, "  | cat "  ||  die;
	print OUTPUT "THIS LINE DOES NOT APPEAR\n";
	close OUTPUT;

	open OUTPUT, "| cat "  ||  die;
	print OUTPUT "THIS LINE DOES     APPEAR\n";
	close OUTPUT;

	exit 0;

Running this program yields (for me):

	print on closed filehandle main::OUTPUT at pt.pl line 7.
	THIS LINE DOES     APPEAR

Here's the output of my 'perl -V':

	Summary of my perl5 (5.0 patchlevel 5 subversion 3) configuration:
	  Platform:
	    osname=hpux, osvers=11.00, archname=PA-RISC2.0
	    uname='hp-ux sbe1351 b.11.00 e 9000889 274894302 8-user license
'
	    hint=previous, useposix=true, d_sigaction=define
	    usethreads=undef useperlio=undef d_sfio=undef
	  Compiler:
	    cc='cc', optimize='-O', gccversion=
	    cppflags='-D_HPUX_SOURCE -Aa +DA2.0W'
	    ccflags ='-D_HPUX_SOURCE -Aa +DA2.0W'
	    stdchar='unsigned char', d_stdstdio=define, usevfork=false
	    intsize=4, longsize=8, ptrsize=8, doublesize=8
	    d_longlong=undef, longlongsize=, d_longdbl=define,
longdblsize=16
	    alignbytes=8, usemymalloc=y, prototype=define
	  Linker and Libraries:
	    ld='ld', ldflags ='+DA2.0W'
	    libpth=/usr/lib/pa20_64
	    libs=-lnsl -lgdbm -ldl -ldld -lm -lc
	    libc=/usr/lib/pa20_64/libc.sl, so=sl, useshrplib=false,
libperl=libperl.a
	  Dynamic Linking:
	    dlsrc=dl_hpux.xs, dlext=sl, d_dlsymun=undef, ccdlflags='-Wl,-E
-Wl,-B,deferred '
	    cccdlflags='+z', lddlflags='-b'

	Characteristics of this binary (from libperl): 
	  Built under hpux
	  Compiled at Feb  9 2000 11:41:29
	  %ENV:
	
PERLLIB="/mbc/mbc509/mbc509/lib/perl:/mbc/mbc509/mbc509/lib/perl/PA-RISC2.0"
	  @INC:
	    /mbc/mbc509/mbc509/lib/perl
	    /mbc/mbc509/mbc509/lib/perl/PA-RISC2.0
	    /usr/local/perl5/lib/5.00503/PA-RISC2.0
	    /usr/local/perl5/lib/5.00503
	    /usr/local/perl5/lib/site_perl/5.005/PA-RISC2.0
	    /usr/local/perl5/lib/site_perl/5.005
    .

NHA
Norman.Azadian@Swisscom.com


Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About