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

Reference NOT Stringified When Used on Left-Hand-Side of `=~' #2291

Closed
p5pRT opened this issue Aug 1, 2000 · 2 comments
Closed

Reference NOT Stringified When Used on Left-Hand-Side of `=~' #2291

p5pRT opened this issue Aug 1, 2000 · 2 comments

Comments

@p5pRT
Copy link

@p5pRT p5pRT commented Aug 1, 2000

Migrated from rt.perl.org#3612 (status was 'resolved')

Searchable as RT3612$

@p5pRT
Copy link
Author

@p5pRT p5pRT commented Aug 1, 2000

From garry@zvolve.com

Created by garry@zvolve.com

A reference is not stringified when used on the left-hand-side of the
`=~' operator. I ran into this trying to get the UCD SNMP module to
make test correctly. Here's how to reproduce the error​:

  $ cat test_ref
  #!/usr/local/bin/perl -w
  $ref = { one => 1, two => 2 };
  print 'ref was ', $ref =~ /^HASH/ ? '' : 'not ', "stringified\n";
  print 'ref($ref) => ', ref($ref), "\n";
  print qq("\$ref" => $ref\n);
  $ perl test_ref
  ref was not stringified
  ref($ref) => HASH
  "$ref" => HASH(0x111160)
  $

I cannot reproduce this error under perl 5.004_04 .

Perl Info

Flags:
    category=core
    severity=medium

This perlbug was built using Perl v5.6.0 - Sat Jun 17 18:59:36 EDT 2000
It is being executed now by  Perl v5.6.0 - Tue Aug  1 07:40:52 EDT 2000.

Site configuration information for perl v5.6.0:

Configured by garry at Tue Aug  1 07:40:52 EDT 2000.

Summary of my perl5 (revision 5.0 version 6 subversion 0) configuration:
  Platform:
    osname=solaris, osvers=2.7, archname=sun4-solaris
    uname='sunos repos 5.7 generic_106541-11 sun4u sparc sunw,ultra-60 '
    config_args=''
    hint=recommended, useposix=true, d_sigaction=define
    usethreads=undef use5005threads=undef useithreads=undef usemultiplicity=undef
    useperlio=undef d_sfio=undef uselargefiles=define 
    use64bitint=undef use64bitall=undef uselongdouble=undef usesocks=undef
  Compiler:
    cc='cc', optimize='-O', gccversion=
    cppflags='-I/usr/local/include'
    ccflags ='-I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64'
    stdchar='char', d_stdstdio=define, usevfork=false
    intsize=4, longsize=4, ptrsize=4, doublesize=8
    d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=16
    ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='off_t', lseeksize=8
    alignbytes=8, usemymalloc=y, prototype=define
  Linker and Libraries:
    ld='cc', ldflags ='-L/usr/local/lib '
    libpth=/usr/local/lib /opt/SUNWspro/SC5.0/lib /lib /usr/lib /usr/ccs/lib
    libs=-lsocket -lnsl -ldb -ldl -lm -lc -lcrypt -lsec
    libc=/lib/libc.so, so=so, useshrplib=false, libperl=libperl.a
  Dynamic Linking:
    dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags=' '
    cccdlflags='-KPIC', lddlflags='-G -L/usr/local/lib'

Locally applied patches:
    


@INC for perl v5.6.0:
    /usr/local/lib/perl5/5.6.0/sun4-solaris
    /usr/local/lib/perl5/5.6.0
    /usr/local/lib/perl5/site_perl/5.6.0/sun4-solaris
    /usr/local/lib/perl5/site_perl/5.6.0
    /usr/local/lib/perl5/site_perl
    .


Environment for perl v5.6.0:
    HOME=/home/garry
    LANG (unset)
    LANGUAGE (unset)
    LC_COLLATE=C
    LC_CTYPE=en_US
    LC_MESSAGES=C
    LC_MONETARY=en_US
    LC_NUMERIC=en_US
    LC_TIME=en_US
    LD_LIBRARY_PATH (unset)
    LOGDIR (unset)
    PATH=/opt/SUNWspro/bin:/bin:/sbin:/usr/sbin:/usr/ccs/bin:/usr/local/bin:/usr/ucb:/usr/dt/bin:/home/garry/bin
    PERL_BADLANG (unset)
    SHELL=/bin/ksh



@p5pRT
Copy link
Author

@p5pRT p5pRT commented Aug 1, 2000

From [Unknown Contact. See original ticket]

On Tue, 1 Aug 2000, Garry T. Williams wrote​:

A reference is not stringified when used on the left-hand-side of the
`=~' operator.

This is a known bug in 5.6, fixed in perl-current. The work around is to
add quotes around the reference.

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

Successfully merging a pull request may close this issue.

None yet
1 participant