develooper Front page | perl.perl5.porters | Postings from November 2001

[ID 20011115.119] no warning for useless /d in tr/0-9//d

Thread Next
From:
sdouglas
Date:
November 15, 2001 05:25
Subject:
[ID 20011115.119] no warning for useless /d in tr/0-9//d
Message ID:
200111151324.NAA07824@threeofsolaris@arm.com
This is a bug report for perl from sdouglass@arm.com,
generated with the help of perlbug 1.33 running under perl v5.6.1.


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

[1a] perl could give a warning, e.g. "Useless use of transliteration (tr///)
in void context", for the following:
    perl -we '$_ = "1x32141x98234"; tr/x//'
    perl -we 'my $x = "1x32141x98234"; $x =~ tr/x//'
and

[1b] (somewhat harder and probably not as useful)
    perl -we '$_ = "1x32141x98234"; tr/a-z/a-def-z//'
    perl -we 'my $x = "1x32141x98234"; $x =~ tr/a-z/a-def-z/'

[2a] perl could give a warning, e.g. "Useless use of /d in
transliteration (tr///)", for the following:
    perl -we 'my $x = "1x32141x98234"; $x =~ tr/x//d'
(which then becomes case [1a]) and

After the /d is known to be useless it could allow
    perl -we '"1x32141x98234" =~ tr/x//d'

[2b] (somewhat harder and probably not as useful)
    perl -we 'my $x = "1x32141x98234"; $x =~ tr/a-z/l-za-m/d'
The tr is useful but the /d isn't.

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

Configured by steve at Wed Apr 25 02:38:38 EDT 2001.

Summary of my perl5 (revision 5.0 version 6 subversion 1) configuration:
  Platform:
    osname=solaris, osvers=2.5.1, archname=sun4-solaris
    uname='sunos smc 5.5.1 generic_103640-32 sun4m sparc sunw,sparcstation-10 '
    config_args='-Dcc=gcc -de'
    hint=recommended, useposix=true, d_sigaction=define
    usethreads=undef use5005threads=undef useithreads=undef usemultiplicity=undef
    useperlio=undef d_sfio=undef uselargefiles=define usesocks=undef
    use64bitint=undef use64bitall=undef uselongdouble=undef
  Compiler:
    cc='gcc', ccflags ='-fno-strict-aliasing -I/usr/local/include ',
    optimize='-O',
    cppflags='-fno-strict-aliasing -I/usr/local/include'
    ccversion='', gccversion='2.95.3 20010315 (release)', gccosandvers='solaris2.5.1'
    intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=4321
    d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=16
    ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='off_t', lseeksize=4
    alignbytes=8, usemymalloc=y, prototype=define
  Linker and Libraries:
    ld='gcc', ldflags =' -L/usr/local/lib '
    libpth=/usr/local/lib /usr/lib /usr/ccs/lib
    libs=-lsocket -lnsl -ldl -lm -lc
    perllibs=-lsocket -lnsl -ldl -lm -lc
    libc=/lib/libc.so, so=so, useshrplib=false, libperl=libperl.a
  Dynamic Linking:
    dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags=' '
    cccdlflags='-fPIC', lddlflags='-G -L/usr/local/lib'

Locally applied patches:
    

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

---
Environment for perl v5.6.1:
    HOME=/home/sdouglas
    LANG (unset)
    LANGUAGE (unset)
    LD_LIBRARY_PATH=/usr/openwin/lib
    LOGDIR (unset)
    PATH=/eda/tools/gnu/native2.2/sunos5.6/bin:/home/sdouglas/bin:/chips/sdt/bin/solrs:/chips/sdt/scripts:/home/sdouglas/sdt/buildtools/bin/solrs:/home/sdouglas/sdt/buildtools/scripts/portable:/usr/local/contrib/bin:/usr/local/lsf/bin:/usr/local/bin:/usr/openwin/bin:/usr/openwin/bin/xview:/usr/local/gnu/bin:/usr/xpg4/bin:/bin:/usr/bin
    PERL_BADLANG (unset)
    SHELL=/bin/tcsh


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