FAQ
Hi there,

Here is a bug (or a feature that is not documented...)
within the warn and the die functions: when you call them
with a string or a list having a null car in it, the output
does _not_ get further than this car.

Here is a very simple test case:
-- BEGIN OF TEST CASE
$ perl -e '$a="foo".chr(0)."bar"; warn $a;'
foo at -e line 1.
$ perl -e '@a=("foo", chr(0), "bar"); warn @a;'
foo at -e line 1.
$ perl -e '$a="foo".chr(0)."bar"; die $a;'
foo at -e line 1.
$ perl -e '@a=("foo", chr(0), "bar"); die @a;'
foo at -e line 1.
-- END OF TEST CASE

In all four cases, one should except the following output:
foobar at -e line 1.


Following is the output of the perl -V call:
-- OUTPUT OF perl -V
$ perl -V
Summary of my perl5 (5.0 patchlevel 5 subversion 3)
configuration:
Platform:
osname=linux, osvers=2.2.1-ac1, archname=i386-linux
uname='linux porky.devel.redhat.com 2.2.1-ac1 #1 smp mon
feb 1 17:44:44 est 1999 i686 unknown '
hint=recommended, useposix=true, d_sigaction=define
usethreads=undef useperlio=undef d_sfio=undef
Compiler:
cc='cc', optimize='-O2', gccversion=egcs-2.91.66
19990314/Linux (egcs-1.1.2 release)
cppflags='-Dbool=char -DHAS_BOOL -I/usr/local/include'
ccflags ='-Dbool=char -DHAS_BOOL -I/usr/local/include'
stdchar='char', d_stdstdio=undef, usevfork=false
intsize=4, longsize=4, ptrsize=4, doublesize=8
d_longlong=define, longlongsize=8, d_longdbl=define,
longdblsize=12
alignbytes=4, usemymalloc=n, prototype=define
Linker and Libraries:
ld='cc', ldflags =' -L/usr/local/lib'
libpth=/usr/local/lib /lib /usr/lib
libs=-lnsl -lndbm -lgdbm -ldb -ldl -lm -lc -lposix
-lcrypt
libc=, so=so, useshrplib=false, libperl=libperl.a
Dynamic Linking:
dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef,
ccdlflags='-rdynamic'
cccdlflags='-fpic', lddlflags='-shared -L/usr/local/lib'


Characteristics of this binary (from libperl):
Built under linux
Compiled at Apr 6 1999 23:34:07
%ENV:
PERL5LIB="/home/jquelin/Prog/lib"
@INC:
/home/jquelin/Prog/lib
/usr/lib/perl5/5.00503/i386-linux
/usr/lib/perl5/5.00503
/usr/lib/perl5/site_perl/5.005/i386-linux
/usr/lib/perl5/site_perl/5.005
.
-- END OF OUTPUT OF perl -V


I know this is not the latest version of perl as of now, but
I could not get access to any platform with perl 5.6
installed. This version of perl is installed from a RPM.

-- OUTPUT OF rpm -qi perl
$ rpm -qi perl
Name : perl Relocations: (not
relocateable)
Version : 5.00503 Vendor: Red
Hat Software
Release : 2 Build Date: Wed
Apr 7 05:37:59 1999
Install date: Thu Jan 20 17:56:48 2000 Build Host:
porky.devel.redhat.com
Group : Development/Languages Source RPM:
perl-5.00503-2.src.rpm
Size : 16156488 License: GPL
Packager : Red Hat Software
<http://developer.redhat.com/bugzilla>
Summary : The Perl programming language.
Description :
Perl is a high-level programming language with roots in C,
sed, awk
and shell scripting. Perl is good at handling processes and
files,
and is especially good at handling text. Perl's hallmarks
are
practicality and efficiency. While it is used to do a lot
of
different things, Perl's most common applications (and what
it excels
at) are probably system administration utilities and web
programming.
A large proportion of the CGI scripts on the web are written
in Perl.
You need the perl package installed on your system so that
your
system can handle Perl scripts.
-- OUTPUT OF rpm -qi perl


First I thought this was the normal behavior, but then I
checked the docs and I could not see anywhere this should
be normal. Then I realized this was maybe a bug, and maybe
in the way perl handles output. But it is specific to
STDERR, as you can see with the following code :

-- BEGIN OF TEST CASE
$ perl -le '$a="foo".chr(0)."bar"; print $a;'
foobar
$ perl -le '@a=("foo", chr(0), "bar"); print @a;'
foobar
-- END OF TEST CASE

This sounds more normal... So please tell me if this is
really a bug and not a documented feature (where is it
documented?), and if it has been corrected as of the current
version.

Well, I hope this will help you. Sorry, no patch to propose
(no time... arghh). Anyway, sorry if this is already known.
We anonymous perl users _do_ appreciate your work. Keep on
going dudes!

Sorry for my bad english, see ya later.
Jerome Quelin

Search Discussions

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupperl5-porters @
categoriesperl
postedMay 19, '01 at 9:08p
activeMay 19, '01 at 9:08p
posts1
users1
websiteperl.org

1 user in discussion

Jerome Quelin: 1 post

People

Translate

site design / logo © 2022 Grokbase