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

constant and -w ? #1295

Closed
p5pRT opened this issue Mar 9, 2000 · 3 comments
Closed

constant and -w ? #1295

p5pRT opened this issue Mar 9, 2000 · 3 comments

Comments

@p5pRT
Copy link

p5pRT commented Mar 9, 2000

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

Searchable as RT2292$

@p5pRT
Copy link
Author

p5pRT commented Mar 9, 2000

From jarausch@igpm.rwth-aachen.de

Created by jarausch@igpm.rwth-aachen.de

Is -w a bit too ambitious?
Look at

use strict;
use constant Var_Offset => 100;

print 200 - Var_Offset,"\n"; # OK
print 200-Var_Offset,"\n"; # emits​: Ambiguous use of -Var_Offset
  # resolved as -&Var_Offset() at ...

Perl Info


Site configuration information for perl v5.6.0:

Configured by jarausch at Tue Mar  7 08:15:38 CST 2000.

Summary of my perl5 (revision 5.0 version 6 subversion 0) configuration:
  Platform:
    osname=irix, osvers=6.5, archname=IP26-irix
    uname='irix64 numa1 6.5 10181059 ip26 '
    config_args='-Dcc=cc -Dprefix=/usr/LOCAL -Dlocincpth=/usr/LOCAL/include -Dloclibpth=/usr/LOCAL/lib'
    hint=previous, 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='-g3 -O3 -OPT:Olimit=0:space=on -mips4', gccversion=
    cppflags='-D_BSD_TYPES -D_BSD_TIME -I/usr/LOCAL/include -DLANGUAGE_C'
    ccflags ='-D_BSD_TYPES -D_BSD_TIME -I/usr/LOCAL/include -DLANGUAGE_C'
    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
    ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='off_t', lseeksize=8
    alignbytes=8, usemymalloc=n, prototype=define
  Linker and Libraries:
    ld='cc', ldflags =' -Wl,-woff,84 -L/usr/LOCAL/lib'
    libpth=/usr/LOCAL/lib /usr/lib32 /lib32
    libs=-lgdbm -ldb -lm -lc
    libc=/usr/lib32/libc.so, so=so, useshrplib=true, libperl=libperl.so
  Dynamic Linking:
    dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='  -Wl,-rpath,/usr/LOCAL/lib/perl5/5.6.0/IP26-irix/CORE'
    cccdlflags='-KPIC', lddlflags='-shared -L/usr/LOCAL/lib'

Locally applied patches:
    v5.6.0-RC1


@INC for perl v5.6.0:
    /usr/LOCAL/lib/perl5/5.6.0/IP26-irix
    /usr/LOCAL/lib/perl5/5.6.0
    /usr/LOCAL/lib/perl5/site_perl/5.6.0/IP26-irix
    /usr/LOCAL/lib/perl5/site_perl/5.6.0
    /usr/LOCAL/lib/perl5/site_perl
    .


Environment for perl v5.6.0:
    HOME=/usr/people/jarausch
    LANG=C
    LANGUAGE (unset)
    LD_LIBRARY_PATH (unset)
    LOGDIR (unset)
    PATH=.:/usr/people/jarausch/bin:/usr/PRIVATE/bin:/usr/LOCAL/bin:/usr/LOCAL/teTeX/bin:/usr/bin:/usr/java/bin:/usr/bsd:/bin:/usr/bin/X11:/usr/local/bin:/usr/local/bin/X11:/usr/sbin:/usr/demos/bin
    PERL_BADLANG (unset)
    SHELL=/bin/zsh




@p5pRT
Copy link
Author

p5pRT commented Mar 9, 2000

From [Unknown Contact. See original ticket]

jarausch@​igpm.rwth-aachen.de wrote

use constant Var_Offset => 100;

print 200 - Var_Offset,"\n"; # OK
print 200-Var_Offset,"\n"; # emits​: Ambiguous use of -Var_Offset
# resolved as -&Var_Offset() at ...

Rummaging in my bug pile, I came across

%perl5.005_62a -we 'sub SLOT() { 23 };print 34-SLOT'
Ambiguous use of -SLOT resolved as -&SLOT() at -e line 1.
11
%

which shows that the problem isn't specific to "use constant" (surprise,
surprise). I *thought* I'd sent it to perlbug, but I can't find
it in the archive. Oh, well. Consider it reported now.

And there's a possibly related example which I *did* report nearly
two years ago (with no response) in

http​://www.xray.mpe.mpg.de/mailing-lists/perl5-porters/1998-04/msg00554.html


%perl -w
use constant WEEK => 7*24*60*60;
$target = time;
$a{$target-WEEK} = 27;
^D
Ambiguous use of -WEEK resolved as -&WEEK() at - line 3.


Mike Guy

@p5pRT
Copy link
Author

p5pRT commented Jul 7, 2003

ziggy@panix.com - Status changed from 'open' to 'resolved'

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

1 participant