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

attributes don't like .= #2286

Open
p5pRT opened this issue Jul 31, 2000 · 5 comments

Comments

@p5pRT
Copy link
Collaborator

@p5pRT p5pRT commented Jul 31, 2000

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

Searchable as RT3605$

@p5pRT

This comment has been minimized.

Copy link
Collaborator Author

@p5pRT p5pRT commented Jul 31, 2000

From @pdcawley

Created by @pdcawley

So, I was playing around, trying to make a japh when I did something like​:

perl -e 'my $var : locked .= "test"'

And perl fell over in a heap with​:

Invalid separator character '.' in attribute list at -e line 1, near "$var : locked "
syntax error at -e line 1, near "$var : locked "
Execution of -e aborted due to compilation errors.

Is this a known bug? A known feature?

Perl Info

Flags:
    category=core
    severity=low

Site configuration information for perl v5.6.0:

Configured by pixel at Fri Mar 31 16:32:49 CEST 2000.

Summary of my perl5 (revision 5.0 version 6 subversion 0) configuration:
  Platform:
    osname=linux, osvers=2.2.15-0.16mdksmp, archname=i386-linux
    uname='linux kenobi.mandrakesoft.com 2.2.15-0.16mdksmp #1 smp mon mar 13 16:40:10 cet 2000 i686 unknown '
    config_args='-des -Dprefix=/usr -Darchname=i386-linux -Dd_dosuid -Dd_semctl_semun -Di_db -Di_ndbm -Di_gdbm -Ud_csh -Dman3dir=/usr/lib/perl5/man/man3 -Doptimize=-O3 -fomit-frame-pointer -fno-exceptions -fno-rtti -pipe -s -mpentium -mcpu=pentium -march=pentium -ffast-math -fexpensive-optimizations'
    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='-O3 -fomit-frame-pointer -fno-exceptions -fno-rtti -pipe -s -mpentium -mcpu=pentium -march=pentium -ffast-math -fexpensive-optimizations', gccversion=2.95.3 19991030 (prerelease)
    cppflags='-fno-strict-aliasing'
    ccflags ='-fno-strict-aliasing -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=12
    ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='off_t', lseeksize=8
    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 -ldl -lm -lc -lposix -lcrypt
    libc=/lib/libc-2.1.3.so, 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'

Locally applied patches:
    


@INC for perl v5.6.0:
    /usr/lib/perl5/5.6.0/i386-linux
    /usr/lib/perl5/5.6.0
    /usr/lib/perl5/site_perl/5.6.0/i386-linux
    /usr/lib/perl5/site_perl/5.6.0
    /usr/lib/perl5/site_perl/5.005/i386-linux
    /usr/lib/perl5/site_perl/5.005
    /usr/lib/perl5/site_perl
    .


Environment for perl v5.6.0:
    HOME=/home/pdcawley
    LANG=en
    LANGUAGE=en_GB:en
    LC_COLLATE=en_GB
    LC_CTYPE=en_GB
    LC_MESSAGES=en_GB
    LC_MONETARY=en_GB
    LC_NUMERIC=en_GB
    LC_TIME=en_GB
    LD_LIBRARY_PATH (unset)
    LOGDIR (unset)
    PATH=/home/postgres/bin:/home/postgres/bin:/home/pdcawley/bin:/opt/IBMJava2-13/bin:/home/postgres/bin:/home/postgres/bin:/home/pdcawley/bin:/opt/IBMJava2-13/bin:/home/postgres/bin:/bin:/usr/bin:/usr/bin/X11:/usr/local/bin:/usr/bin:/usr/X11R6/bin:/usr/games:/usr/X11R6/bin:/usr/games:/usr/X11R6/bin:/usr/games:/usr/X11R6/bin:/usr/games:/usr/X11R6/bin:/usr/games
    PERL_BADLANG (unset)
    SHELL=/bin/bash



@p5pRT

This comment has been minimized.

Copy link
Collaborator Author

@p5pRT p5pRT commented Jun 7, 2008

From module@renee-baecker.de

I don't know if this should be valid syntax. It's a declaration of a
variable, so there's nothing to concatenate...

@p5pRT

This comment has been minimized.

Copy link
Collaborator Author

@p5pRT p5pRT commented Jun 10, 2008

From p5p@spam.wizbit.be

From the bug report​:

perl -e 'my $var : locked .= "test"'
Invalid separator character '.' in attribute list at -e line 1, near
"$var : locked "
syntax error at -e line 1, near "$var : locked "
Execution of -e aborted due to compilation errors.

On Sat Jun 07 11​:27​:16 2008, reneeb wrote​:

I don't know if this should be valid syntax. It's a declaration of a
variable, so there's nothing to concatenate...

But​:

perl -e 'my $var .= "test";'

Does not produce a syntax error.

Should this inconsistency remain? Or should it go away?

@p5pRT

This comment has been minimized.

Copy link
Collaborator Author

@p5pRT p5pRT commented Sep 25, 2012

From @cpansprout

On Tue Jun 10 03​:32​:54 2008, animator wrote​:

From the bug report​:

perl -e 'my $var : locked .= "test"'
Invalid separator character '.' in attribute list at -e line 1, near
"$var : locked "
syntax error at -e line 1, near "$var : locked "
Execution of -e aborted due to compilation errors.

On Sat Jun 07 11​:27​:16 2008, reneeb wrote​:

I don't know if this should be valid syntax. It's a declaration of a
variable, so there's nothing to concatenate...

But​:

perl -e 'my $var .= "test";'

Does not produce a syntax error.

Should this inconsistency remain? Or should it go away?

It’s also a problem with just plain ‘.’. In fact, the introduction of
attributes broke this perfectly valid syntax​:

$ ./perl -Ilib -e '$ref = \($1 ? my $var : my $othervar)'
Invalid separator character '$' in attribute list at -e line 1, near
"$var : my "
Execution of -e aborted due to compilation errors.

I’m not even sure how the attribute syntax should behave.

--

Father Chrysostomos

@p5pRT

This comment has been minimized.

Copy link
Collaborator Author

@p5pRT p5pRT commented Sep 26, 2012

From @rjbs

* Father Chrysostomos via RT <perlbug-followup@​perl.org> [2012-09-25T15​:51​:31]

Should this inconsistency remain? Or should it go away?

"Surely" it should be fixed, but​:

It’s also a problem with just plain ‘.’. In fact, the introduction of
attributes broke this perfectly valid syntax​:

$ ./perl -Ilib -e '$ref = \($1 ? my $var : my $othervar)'
Invalid separator character '$' in attribute list at -e line 1, near
"$var : my "
Execution of -e aborted due to compilation errors.

I’m not even sure how the attribute syntax should behave.

That's a heck of a nice bug you got there, chief. I want to say "it at least
needs a better error message," but then I start to think that if it was fixed
that far, it might be fixable.

Nasty.

--
rjbs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
1 participant
You can’t perform that action at this time.