develooper Front page | perl.perl5.porters | Postings from April 2000

[ID 20000415.005] perlsub (Constant functions) suggest use ofdeprecated $]

Thread Next
From:
David Dyck
Date:
April 15, 2000 11:42
Subject:
[ID 20000415.005] perlsub (Constant functions) suggest use ofdeprecated $]
Message ID:
200004151842.LAA16826@dd.tc.fluke.com

This is a bug report for perl from dcd@tc.fluke.com,
generated with the help of perlbug 1.28 running under perl v5.6.0.


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

The documentation in perlvar.pod for the perl variable $], states:
 "The use of this variable is deprecated."

But in perlsub/"Constant Functions" a method of thwarting
the inlining mechanism while preserving the prototype
is suggested using $];

    sub not_inlined () {
        23 if $];
    }

I think this is inconsistent.

Could someone please suggest a 'better' example for  
perlsub/"Constant Functions" to use here.

Thanks,
  David Dyck

I came across this while working with some code like 
the following perl code which prints the following diagnostics.

use diagnostics;
sub d() { return "one\n"; }
undef &d;

Constant subroutine d undefined at ebug.pl line 4 (#1)
    
    (W misc) You undefined a subroutine which had previously been eligible for
    inlining.  See perlsub/"Constant Functions" for commentary and
    workarounds.



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

Configured by dcd at Thu Mar 23 14:52:39 PST 2000.

Summary of my perl5 (revision 5.0 version 6 subversion 0) configuration:
  Platform:
    osname=linux, osvers=2.3.99-pre3, archname=i686-linux
    uname='linux dd 2.3.99-pre3 #1 wed mar 22 10:40:34 pst 2000 i686 '
    config_args='-Doptimize=-O3 -g -de -Dcf_email=dcd@tc.fluke.com'
    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 -g', gccversion=2.7.2.3
    cppflags='-DDEBUGGING -I/usr/local/include'
    ccflags ='-DDEBUGGING -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', ivsize=4, nvtype='double', nvsize=8, Off_t='off_t', lseeksize=4
    alignbytes=4, usemymalloc=n, prototype=define
  Linker and Libraries:
    ld='cc', ldflags =' -L/usr/local/lib'
    libpth=/usr/local/lib /lib /usr/lib
    libs=-lgdbm -ldbm -ldb -ldl -lm -lc
    libc=/lib/libc.so.5.4.44, 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/local/lib/perl5/5.6.0/i686-linux
    /usr/local/lib/perl5/5.6.0
    /usr/local/lib/perl5/site_perl/5.6.0/i686-linux
    /usr/local/lib/perl5/site_perl/5.6.0
    /usr/local/lib/perl5/site_perl
    .

---
Environment for perl v5.6.0:
    HOME=/home/dcd
    LANG (unset)
    LANGUAGE (unset)
    LD_LIBRARY_PATH (unset)
    LOGDIR (unset)
    PATH=/home/dcd/bin:/sbin:/usr/local/bin:/bin:/usr/bin:/usr/X11/bin:/usr/games:/usr/local/samba:/home/hobbes/tools/scripts:/home/hobbes/tools/linux:/usr0/hobbes/tools/scripts:/usr0/dcd/bin:/apps/general/bin:/usr/public
    PERL_BADLANG (unset)
    SHELL=/bin/bash

Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About