develooper Front page | perl.perl5.porters | Postings from February 2001

[ID 20010227.002] my() fights with backtick

Thread Next
From:
ric
Date:
February 27, 2001 10:48
Subject:
[ID 20010227.002] my() fights with backtick
Message ID:
200102271848.f1RIm4101630@sylvester.Telcom.Arizona.EDU

This is a bug report for perl from staff@ms.telcom.arizona.edu,
generated with the help of perlbug 1.26 running under perl 5.00503.


-----------------------------------------------------------------
[Please enter your report here]
The following simple program only places the first line of
output in $s if the backtick and assignment are combined with my().

E.g.
  my($s) = `echo  "line1\nline2\nline3\n"`;
  print "$s\n--\n";
produces
  line1

  --
while
  $s = `echo  "line1\nline2\nline3\n"`;
  print "$s\n--\n";
OR
  my($s);
  $s = `echo  "line1\nline2\nline3\n"`;
  print "$s\n--\n";
produces
  line1
  line2
  line3
  
  
  --

Why does merging the assignemnt of program output and my() truncate
the output?

N.B.  This problem reproduced on another system (Perl 5.6/Solaris 7).

[Please do not change anything below this line]
-----------------------------------------------------------------

---
Site configuration information for perl 5.00503:

Configured by ric at Mon Aug  7 13:59:26 MST 2000.

Summary of my perl5 (5.0 patchlevel 5 subversion 3) configuration:
  Platform:
    osname=solaris, osvers=2.6, archname=sun4-solaris
    uname='sunos coyote.telcom.arizona.edu 5.6 generic_105181-16 sun4u sparc sunw,ultra-enterprise '
    hint=recommended, useposix=true, d_sigaction=define
    usethreads=undef useperlio=undef d_sfio=undef
  Compiler:
    cc='gcc -B/usr/ccs/bin/', optimize='-O', gccversion=egcs-2.91.66 19990314 (egcs-1.1.2 release)
    cppflags='-I/usr/local/include'
    ccflags ='-I/usr/local/include'
    stdchar='unsigned char', d_stdstdio=define, usevfork=false
    intsize=4, longsize=4, ptrsize=4, doublesize=8
    d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=16
    alignbytes=8, usemymalloc=y, prototype=define
  L`my($s) = inkel and Libraries:
    ld='gcc -B/usr/ccs/bin/', ldflags ='-L/usr/local/lib -R/usr/local/lib'
    libpth=/usr/local/lib /usr/ccs/lib /usr/openwin/lib /usr/dt/lib /usr/lib
    libs=-lsocket -lnsl -ldl -lm -lc -lcrypt
    libc=/lib/libc.so, so=so, useshrplib=false, libperl=libperl.a
  Dynamic Linking:
    dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags=' '
    cccdlflags='-fPIC', lddlflags='-G -L/usr/local/lib -R/usr/local/lib'

Locally applied patches:
    

---
@INC for perl 5.00503:
    /usr/local/lib/perl5/5.00503/sun4-solaris
    /usr/local/lib/perl5/5.00503
    /usr/local/lib/perl5/site_perl/5.005/sun4-solaris
    /usr/local/lib/perl5/site_perl/5.005
    .

---
Environment for perl 5.00503:
    HOME=/home/ric
    LANG (unset)
    LANGUAGE (unset)
    LD_LIBRARY_PATH (unset)
    LOGDIR (unset)
    PATH=/home/ric/bin/sparc:/home/ric/bin/Scripts:/usr/bin:/usr/ccs/bin:/usr/openwin/bin:/usr/dt/bin:/usr/local/bin:/usr/proc/bin
    PERL_BADLANG (unset)
    SHELL=/bin/ksh


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