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

[ID 20010328.012] Different behavior using the -Idir option onthe command line and inside a perl script

Thread Next
From:
root
Date:
March 28, 2001 12:44
Subject:
[ID 20010328.012] Different behavior using the -Idir option onthe command line and inside a perl script
Message ID:
200103282058.f2SKwUR02166@beo1.lsd.di.uminho.pt

This is a bug report for perl from jpo@di.uminho.pt,
generated with the help of perlbug 1.28 running under perl v5.6.0.


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

The command line -Idir option does different things to the global @INC array
when used on the command line (shell) and on the first line of a script (#!).

Used on the command line it places the directory at the beginning of the @INC
array as expected.

	---
	perl -I/tmp/mydir -e 'print join "\n", @INC'
	---

	--- output starts here ---
	/tmp/mydir
	/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
	.
	--- output ends here ---

But when used on the first line of a script, it places the directory in question
both at the beginning and at the end of the @INC array.

	--- script starts here ---
	#!/usr/bin/perl -I/tmp/mydir
	print join "\n", @INC;
	--- script ends here ---

	--- output starts here ---
	/tmp/mydir
	/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
	.
	/tmp/mydir
	--- output ends here ---

I also got the same results when I run the above examples
under Perl version 5.005_03 built for i386-linux.




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

Configured by prospector at Mon Aug  7 10:58:30 EDT 2000.

Summary of my perl5 (revision 5.0 version 6 subversion 0) configuration:
  Platform:
    osname=linux, osvers=2.2.5-22smp, archname=i386-linux
    uname='linux porky.devel.redhat.com 2.2.5-22smp #1 smp wed jun 2 09:11:51 edt 1999 i686 unknown '
    config_args='-des -Doptimize=-O2 -march=i386 -mcpu=i686 -Dcc=gcc -Dcccdlflags=-fPIC -Dinstallprefix=/usr -Dprefix=/usr -Darchname=i386-linux -Dd_dosuid -Dd_semctl_semun -Di_db -Di_ndbm -Di_gdbm -Di_shadow -Di_syslog -Dman3ext=3pm -Uuselargefiles'
    hint=recommended, useposix=true, d_sigaction=define
    usethreads=undef use5005threads=undef useithreads=undef usemultiplicity=undef
    useperlio=undef d_sfio=undef uselargefiles=undef 
    use64bitint=undef use64bitall=undef uselongdouble=undef usesocks=undef
  Compiler:
    cc='gcc', optimize='-O2 -march=i386 -mcpu=i686', gccversion=2.96 20000731 (experimental)
    cppflags='-fno-strict-aliasing'
    ccflags ='-fno-strict-aliasing'
    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='gcc', ldflags =' -L/usr/local/lib'
    libpth=/usr/local/lib /lib /usr/lib
    libs=-lnsl -ldl -lm -lc -lcrypt
    libc=/lib/libc-2.1.92.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
    .

---
Environment for perl v5.6.0:
    HOME=/root
    LANG=en_US
    LANGUAGE (unset)
    LD_LIBRARY_PATH (unset)
    LOGDIR (unset)
    PATH=/usr/local/sbin:/usr/sbin:/sbin:/usr/kerberos/sbin:/usr/kerberos/bin:/bin:/usr/bin:/usr/local/bin:/usr/X11R6/bin:/usr/X11R6/bin:/root/bin
    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