Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Localized */ isnt observed by magic IO operator #7712

Open
p5pRT opened this issue Dec 16, 2004 · 6 comments
Open

Localized */ isnt observed by magic IO operator #7712

p5pRT opened this issue Dec 16, 2004 · 6 comments

Comments

@p5pRT
Copy link

p5pRT commented Dec 16, 2004

Migrated from rt.perl.org#33076 (status was 'open')

Searchable as RT33076$

@p5pRT
Copy link
Author

p5pRT commented Dec 16, 2004

From @demerphq

Created by @demerphq

The following code does not work as expected​:

perl -le "$/='foo'; local */; print 'Got​:',$/; while(<>) { chomp; print; }"

Even though the "Got​:" output will be correct <> will still think that $/ is
equal to 'foo'

Ive tested this on 5.6.1 and 5.8.4 and both fail.

Perl Info

Flags:
    category=core
    severity=low

Site configuration information for perl v5.6.1:

Configured by ActiveState at Tue Apr 13 19:24:10 2004.

Summary of my perl5 (revision 5 version 6 subversion 1) configuration:
  Platform:
    osname=MSWin32, osvers=4.0, archname=MSWin32-x86-multi-thread
    uname=''
    config_args='undef'
    hint=recommended, useposix=true, d_sigaction=undef
    usethreads=undef use5005threads=undef useithreads=define
usemultiplicity=define
    useperlio=undef d_sfio=undef uselargefiles=undef usesocks=undef
    use64bitint=undef use64bitall=undef uselongdouble=undef
  Compiler:
    cc='cl', ccflags ='-nologo -O1 -MD -Zi -DNDEBUG -DWIN32 -D_CONSOLE
-DNO_STRICT -DHAVE_DES_FCRYPT  -DPERL_IMPLICIT_CONTEXT -DPERL_IMPLICIT_SYS
-DPERL_MSVCRT_READFIX',
    optimize='-O1 -MD -Zi -DNDEBUG',
    cppflags='-DWIN32'
    ccversion='', gccversion='', gccosandvers=''
    intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=1234
    d_longlong=undef, longlongsize=8, d_longdbl=define, longdblsize=10
    ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='off_t',
lseeksize=4
    alignbytes=8, usemymalloc=n, prototype=define
  Linker and Libraries:
    ld='link', ldflags ='-nologo -nodefaultlib -release
-libpath:"E:\Perl\lib\CORE"  -machine:x86'
    libpth="E:\DotNet\FrameworkSDK\Lib\" "E:\Perl\lib\CORE"
    libs=  oldnames.lib kernel32.lib user32.lib gdi32.lib winspool.lib
comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib  netapi32.lib
uuid.lib wsock32.lib mpr.lib winmm.lib  version.lib odbc32.lib odbccp32.lib
msvcrt.lib
    perllibs=  oldnames.lib kernel32.lib user32.lib gdi32.lib winspool.lib
comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib  netapi32.lib
uuid.lib wsock32.lib mpr.lib winmm.lib  version.lib odbc32.lib odbccp32.lib
msvcrt.lib
    libc=msvcrt.lib, so=dll, useshrplib=yes, libperl=perl56.lib
  Dynamic Linking:
    dlsrc=dl_win32.xs, dlext=dll, d_dlsymun=undef, ccdlflags=' '
    cccdlflags=' ', lddlflags='-dll -nologo -nodefaultlib -release
-libpath:"E:\Perl\lib\CORE"  -machine:x86'

Locally applied patches:
    ACTIVEPERL_LOCAL_PATCHES_ENTRY


@INC for perl v5.6.1:
    D:\development\perl\devlib
    E:/Perl/lib
    E:/Perl/site/lib
    .


Environment for perl v5.6.1:
    HOME (unset)
    LANG (unset)
    LANGUAGE (unset)
    LD_LIBRARY_PATH (unset)
    LOGDIR (unset)
 
PATH=E:\Perl\bin\;E:\DotNet\Common7\IDE;E:\DotNet\VC7\BIN;E:\DotNet\Common7\
Tools;E:\DotNet\Common7\Tools\bin\prerelease;E:\DotNet\Common7\Tools\bin;E:\
DotNet\FrameworkSDK\bin;C:\WINNT\Microsoft.NET\Framework\v1.0.3705;e:\sybase
\OCS-12_0\dll;e:\sybase\OCS-12_0\bin;C:\WINNT\system32;C:\Program
Files\Symantec\pcAnywhere\;C:\WINNT;C:\WINNT\System32\Wbem;E:\Editors\ULTRAE
~1;E:\Perforce;E:\Perl\bin\;E:\bin;E:\cygwin\bin;E:\perl58\bin;E:\sybase;E:\
sybase\sqladvantage;e:\sybase\ASEP;e:\sybase\SQLRemote\dll;perl\bleadperl\bi
n
    PERL5LIB=D:\development\perl\devlib
    PERL5_CPANPLUS_CONFIG=e:\.cpanplus\config
    PERL_BADLANG (unset)
    SHELL (unset)

@p5pRT
Copy link
Author

p5pRT commented Dec 16, 2004

From @demerphq

perl -le "$/='foo'; local */; print 'Got​:',$/; while(<>) {
chomp; print; }"

Even though the "Got​:" output will be correct <> will still
think that $/ is
equal to 'foo'

Ive tested this on 5.6.1 and 5.8.4 and both fail.

And another glob related oddity​:

perl -e "use strict; use warnings; our $foo; local *foo='​:'; print $foo"

Outputs a newline followed by a dash on my system (Win32). Even though the
statement is garbage I cant help but think that this result is wrong.

Yves

@p5pRT
Copy link
Author

p5pRT commented Dec 16, 2004

From @demerphq

yo> perl -e "use strict; use warnings; our $foo; local *foo='​:'; print
yo> $foo"

yo> Outputs a newline followed by a dash on my system (Win32).

As it should, since the glob-aliasing made it equivalent to this​:

\# perl \-e 'print $&#8203;:'

Right. Thanks. What about the other part? That is a bug eh?

Yves

@p5pRT
Copy link
Author

p5pRT commented Dec 17, 2004

From perl5-porters@perl.org

On Thu, 16 Dec 2004 18​:59​:02 -0000, "Orton, Yves" wrote (in part)​:

yo> And another glob related oddity​:

yo> perl -e "use strict; use warnings; our $foo; local *foo='​:'; print
yo> $foo"

yo> Outputs a newline followed by a dash on my system (Win32).

As it should, since the glob-aliasing made it equivalent to this​:

  # perl -e 'print $​:'

leggy​:7168> mperl -MDevel​::Peek=Dump -e 'Dump \$​:'
SV = RV(0x140044838) at 0x1400061e8
  REFCNT = 1
  FLAGS = (TEMP,ROK)
  RV = 0x140022ad8
  SV = PVMG(0x140028078) at 0x140022ad8
  REFCNT = 2
  FLAGS = (GMG,SMG,pPOK)
  IV = 0
  NV = 0
  PV = 0x140007b98 " \n-"\0
  CUR = 3
  LEN = 4
  MAGIC = 0x1400257c8
  MG_VIRTUAL = &PL_vtbl_sv
  MG_TYPE = PERL_MAGIC_sv(\0)
  MG_OBJ = 0x1400062d8
  MG_LEN = 1
  MG_PTR = 0x140007b78 "​:"
leggy​:7169>

Note that "PV =" of space+newline+hyphen.

  --s.

@p5pRT
Copy link
Author

p5pRT commented Dec 17, 2004

The RT System itself - Status changed from 'new' to 'open'

@toddr
Copy link
Member

toddr commented Feb 13, 2020

@demerphq Is there an action here?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants