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

"print (...) interpreted as function", but only sometimes. #2654

Open
p5pRT opened this issue Sep 25, 2000 · 3 comments
Open

"print (...) interpreted as function", but only sometimes. #2654

p5pRT opened this issue Sep 25, 2000 · 3 comments

Comments

@p5pRT
Copy link

p5pRT commented Sep 25, 2000

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

Searchable as RT4346$

@p5pRT
Copy link
Author

p5pRT commented Sep 25, 2000

From @Abigail

Created by @Abigail

It seems that Perl issues the 'print (...) interpreted as function'
warning depending on whether the print statement is terminated by
a semicolon, and depending on the arguments.

  $ cat eek1.pl
  print ("((");
  print (">>");
  $ perl -wl eek1.pl
  print (...) interpreted as function at eek1.pl line 1.
  ((
  >>
  $ cat eek2.pl
  print ("((");
  print (">>")
  $ perl -wl eek2.pl
  print (...) interpreted as function at eek2.pl line 1.
  print (...) interpreted as function at eek2.pl line 2.
  ((
  >>
  $ cat eek3.pl
  print (">>");
  print ("((");
  $ perl -wl eek3.pl
  print (...) interpreted as function at eek3.pl line 2.
  >>
  ((
  $ cat eek4.pl
  print (")");
  print ("))");
  $ perl -wl eek4.pl
  print (...) interpreted as function at eek4.pl line 1.
  )
  ))
  $

There's a warning if the print statement is not terminated by a semicolon,
or if the argument is a closing brace followed by only whitespace, or starts
with one or more opening braces. In other cases, it doesn't seem to emit the
warning. This is disturbing.

Abigail

Perl Info

Flags:
    category=core
    severity=medium

Site configuration information for perl v5.6.0:

Configured by abigail at Wed Jun 14 21:00:02 EDT 2000.

Summary of my perl5 (revision 5.0 version 6 subversion 0) configuration:
  Platform:
    osname=linux, osvers=2.2.13, archname=i686-linux-64int
    uname='linux alexandra 2.2.13 #5 tue feb 8 15:37:54 est 2000 i686 unknown '
    config_args='-Dprefix=/opt/perl -d -Uinstallusrbinperl -Doptimize=-g -Dusemorebits'
    hint=recommended, useposix=true, d_sigaction=define
    usethreads=undef use5005threads=undef useithreads=undef usemultiplicity=undef
    useperlio=undef d_sfio=undef uselargefiles=define 
    use64bitint=define use64bitall=undef uselongdouble=define usesocks=undef
  Compiler:
    cc='cc', optimize='-g', gccversion=2.95.2 19991024 (release)
    cppflags='-DDEBUGGING -fno-strict-aliasing -I/usr/local/include'
    ccflags ='-DDEBUGGING -fno-strict-aliasing -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=12
    ivtype='long long', ivsize=8, nvtype='long double', nvsize=12, 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 -lndbm -lgdbm -ldbm -ldb -ldl -lm -lc -lposix -lcrypt
    libc=/lib/libc-2.1.2.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:
    /home/abigail/Perl
    /home/abigail/Sybase
    /opt/perl/lib/5.6.0/i686-linux-64int
    /opt/perl/lib/5.6.0
    /opt/perl/lib/site_perl/5.6.0/i686-linux-64int
    /opt/perl/lib/site_perl/5.6.0
    /opt/perl/lib/site_perl/5.005
    /opt/perl/lib/site_perl
    .


Environment for perl v5.6.0:
    HOME=/home/abigail
    LANG (unset)
    LANGUAGE (unset)
    LD_LIBRARY_PATH=/home/abigail/Lib:/usr/local/lib:/usr/lib:/lib:/usr/X11R6/lib:/opt/tcl/lib:/opt/tk/lib/tk8.0
    LOGDIR (unset)
    PATH=/home/abigail/Bin:/opt/perl/bin:/opt/tcl/bin:/opt/tk/bin:/usr/local/bin:/usr/local/X11/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin:/usr/X11R6/bin:/usr/games:/opt/povray/bin:/opt/teTeX/bin/i686-pc-linux-gnu:/opt/python/bin:/opt/acrobat/bin
    PERL5LIB=/home/abigail/Perl:/home/abigail/Sybase
    PERLDIR=/opt/perl
    PERL_BADLANG (unset)
    SHELL=/bin/bash


@p5pRT
Copy link
Author

p5pRT commented Sep 25, 2000

From [Unknown Contact. See original ticket]

what about

perl -we '( print ("hi") )'

no warnings.

--chicheng

On 25 Sep 2000 abigail@​foad.org wrote​:

This is a bug report for perl from abigail@​foad.org,
generated with the help of perlbug 1.28 running under perl v5.6.0.

-----------------------------------------------------------------
[Please enter your report here]

It seems that Perl issues the 'print (...) interpreted as function'
warning depending on whether the print statement is terminated by
a semicolon, and depending on the arguments.

$ cat eek1.pl
print ("((");
print (">>");
$ perl -wl eek1.pl
print (...) interpreted as function at eek1.pl line 1.
((

$ cat eek2.pl
print ("((");
print (">>")
$ perl -wl eek2.pl
print (...) interpreted as function at eek2.pl line 1.
print (...) interpreted as function at eek2.pl line 2.
((

$ cat eek3.pl
print (">>");
print ("((");
$ perl -wl eek3.pl
print (...) interpreted as function at eek3.pl line 2.

((
$ cat eek4.pl
print (")");
print ("))");
$ perl -wl eek4.pl
print (...) interpreted as function at eek4.pl line 1.
)
))
$

There's a warning if the print statement is not terminated by a semicolon,
or if the argument is a closing brace followed by only whitespace, or starts
with one or more opening braces. In other cases, it doesn't seem to emit the
warning. This is disturbing.

Abigail

[Please do not change anything below this line]
-----------------------------------------------------------------
---
Flags​:
category=core
severity=medium
---
Site configuration information for perl v5.6.0​:

Configured by abigail at Wed Jun 14 21​:00​:02 EDT 2000.

Summary of my perl5 (revision 5.0 version 6 subversion 0) configuration​:
Platform​:
osname=linux, osvers=2.2.13, archname=i686-linux-64int
uname='linux alexandra 2.2.13 #5 tue feb 8 15​:37​:54 est 2000 i686 unknown '
config_args='-Dprefix=/opt/perl -d -Uinstallusrbinperl -Doptimize=-g -Dusemorebits'
hint=recommended, useposix=true, d_sigaction=define
usethreads=undef use5005threads=undef useithreads=undef usemultiplicity=undef
useperlio=undef d_sfio=undef uselargefiles=define
use64bitint=define use64bitall=undef uselongdouble=define usesocks=undef
Compiler​:
cc='cc', optimize='-g', gccversion=2.95.2 19991024 (release)
cppflags='-DDEBUGGING -fno-strict-aliasing -I/usr/local/include'
ccflags ='-DDEBUGGING -fno-strict-aliasing -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=12
ivtype='long long', ivsize=8, nvtype='long double', nvsize=12, 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 -lndbm -lgdbm -ldbm -ldb -ldl -lm -lc -lposix -lcrypt
libc=/lib/libc-2.1.2.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​:
/home/abigail/Perl
/home/abigail/Sybase
/opt/perl/lib/5.6.0/i686-linux-64int
/opt/perl/lib/5.6.0
/opt/perl/lib/site_perl/5.6.0/i686-linux-64int
/opt/perl/lib/site_perl/5.6.0
/opt/perl/lib/site_perl/5.005
/opt/perl/lib/site_perl
.

---
Environment for perl v5.6.0​:
HOME=/home/abigail
LANG (unset)
LANGUAGE (unset)
LD_LIBRARY_PATH=/home/abigail/Lib​:/usr/local/lib​:/usr/lib​:/lib​:/usr/X11R6/lib​:/opt/tcl/lib​:/opt/tk/lib/tk8.0
LOGDIR (unset)
PATH=/home/abigail/Bin​:/opt/perl/bin​:/opt/tcl/bin​:/opt/tk/bin​:/usr/local/bin​:/usr/local/X11/bin​:/usr/bin​:/bin​:/usr/local/sbin​:/usr/sbin​:/sbin​:/usr/X11R6/bin​:/usr/games​:/opt/povray/bin​:/opt/teTeX/bin/i686-pc-linux-gnu​:/opt/python/bin​:/opt/acrobat/bin
PERL5LIB=/home/abigail/Perl​:/home/abigail/Sybase
PERLDIR=/opt/perl
PERL_BADLANG (unset)
SHELL=/bin/bash

@p5pRT
Copy link
Author

p5pRT commented Mar 21, 2006

From @smpeters

[abigail - Mon Sep 25 05​:22​:50 2000]​:

This is a bug report for perl from abigail@​foad.org,
generated with the help of perlbug 1.28 running under perl v5.6.0.

-----------------------------------------------------------------
[Please enter your report here]

It seems that Perl issues the 'print (...) interpreted as function'
warning depending on whether the print statement is terminated by
a semicolon, and depending on the arguments.

$ cat eek1.pl
print ("((");
print (">>");
$ perl -wl eek1.pl
print (...) interpreted as function at eek1.pl line 1.
((

$ cat eek2.pl
print ("((");
print (">>")
$ perl -wl eek2.pl
print (...) interpreted as function at eek2.pl line 1.
print (...) interpreted as function at eek2.pl line 2.
((

$ cat eek3.pl
print (">>");
print ("((");
$ perl -wl eek3.pl
print (...) interpreted as function at eek3.pl line 2.

((
$ cat eek4.pl
print (")");
print ("))");
$ perl -wl eek4.pl
print (...) interpreted as function at eek4.pl line 1.
)
))
$

There's a warning if the print statement is not terminated by a
semicolon,
or if the argument is a closing brace followed by only whitespace, or
starts
with one or more opening braces. In other cases, it doesn't seem to
emit the
warning. This is disturbing.

It looks like say(...) has picked up this problem as well.

./perl -Ilib -wl /tmp/eek1.pl
say (...) interpreted as function at /tmp/eek1.pl line 3.
say (...) interpreted as function at /tmp/eek1.pl line 4.
((

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

2 participants