@ARGV vanished!

D

Dean Hannotte

I am using ActiveState Perl on a Windows 2000 Professional machine.
Several weeks ago my Perl scripts stopped accepting arguments. @ARGV is
always empty! I thought that rebooting might help, but it didn't. I
searched for files within C:\Perl that might be dated anytime in 2005,
but there were none, so I don't think any of these files have been
clobbered. Maybe the registry was clobbered, but I wouldn't know what
to look for in this case. Can anyone suggest anything I might try??
THANKS!

Dean Hannotte
(e-mail address removed)

P.S. The remainder of this message shows the output of issuing "perl
-V" on my machine:
-------------------------------------------------------------------------
C:\>perl -V
Summary of my perl5 (revision 5 version 6 subversion 1) configuration:
Platform:
osname=MSWin32, osvers=4.0, archname=MSWin32-x86-multi-thread
uname=''
config_args='undef'
hint=recommended, useposix=true, d_sigaction=undef
usethreads=undef use5005threads=undef useithreads=define
usemultiplicity=def
ine
useperlio=undef d_sfio=undef uselargefiles=undef usesocks=undef
use64bitint=undef use64bitall=undef uselongdouble=undef
Compiler:
cc='cl', ccflags ='-nologo -O1 -MD -DNDEBUG -DWIN32 -D_CONSOLE
-DNO_STRICT -
DHAVE_DES_FCRYPT -DPERL_IMPLICIT_CONTEXT -DPERL_IMPLICIT_SYS
-DPERL_MSVCRT_READ
FIX',
optimize='-O1 -MD -DNDEBUG',
cppflags='-DWIN32'
ccversion='', gccversion='', gccosandvers=''
intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=1234
d_longlong=undef, longlongsize=8, d_longdbl=define, longdblsize=10
ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='off_t',
lseeksize
=4
alignbytes=8, usemymalloc=n, prototype=define
Linker and Libraries:
ld='link', ldflags ='-nologo -nodefaultlib -release
-libpath:"C:/Perl\lib\C
ORE" -machine:x86'
libpth="C:\Perl\lib\CORE"
libs= oldnames.lib kernel32.lib user32.lib gdi32.lib winspool.lib
comdlg32
..lib advapi32.lib shell32.lib ole32.lib oleaut32.lib netapi32.lib
uuid.lib wsoc
k32.lib mpr.lib winmm.lib version.lib odbc32.lib odbccp32.lib
msvcrt.lib
perllibs= oldnames.lib kernel32.lib user32.lib gdi32.lib
winspool.lib comd
lg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib netapi32.lib
uuid.lib
wsock32.lib mpr.lib winmm.lib version.lib odbc32.lib odbccp32.lib
msvcrt.lib
libc=msvcrt.lib, so=dll, useshrplib=yes, libperl=perl56.lib
Dynamic Linking:
dlsrc=dl_win32.xs, dlext=dll, d_dlsymun=undef, ccdlflags=' '
cccdlflags=' ', lddlflags='-dll -nologo -nodefaultlib -release
-libpath:"C:
/Perl\lib\CORE" -machine:x86'


Characteristics of this binary (from libperl):
Compile-time options: MULTIPLICITY USE_ITHREADS PERL_IMPLICIT_CONTEXT
PERL_IMP
LICIT_SYS
Locally applied patches:
ActivePerl Build 633
Built under MSWin32
Compiled at Jun 17 2002 21:33:05
@INC:
C:/perl/lib
C:/perl/site/lib
 
J

jl_post

Dean said:
I am using ActiveState Perl on a Windows 2000 Professional
machine. Several weeks ago my Perl scripts stopped accepting
arguments. @ARGV is always empty! I thought that rebooting
might help, but it didn't. I searched for files within C:\Perl
that might be dated anytime in 2005, but there were none, so I
don't think any of these files have been clobbered. Maybe the
registry was clobbered, but I wouldn't know what to look for
in this case. Can anyone suggest anything I might try??
THANKS!


Dear Dean,

I don't know off-hand what is causing your problem, but I do have a
suggestion:

View your registry with "regedit". Specifically, go to:

My Computer
HKEY_CLASSES_ROOT
Perl
shell
Open
command

What does the Data section hold? Mine has:

"C:\Perl\bin\perl.exe" "%1" %*

I get the impression that if %1 and %* are missing, then no parameters
will be passed into your Perl scripts and @ARGV will be empty.

WARNING: ALWAYS make a back-up copy of your registry before editing
it!

(Please understand that I am not responsible for anything if something
bad should happen as a result of registry editing.)

Anyway, maybe you can figure out what's wrong based on this
information.

I hope something will work, Dean.

-- Jean-Luc
 
D

Dean Hannotte

Jean-Luc,

Thanks so much for your help. My registry is a little different. I have
no Perl key under HKEY_CLASSES_ROOT, but I did find the line you site
here:

My Computer
HKEY_LOCAL_MACHINE
Software
Classes
Applications
Perl.exe
shell
Open
Command

The Data section says

C:\Perl\bin\Perl.exe "%1" %*

Do you have any further suggestions on how I could figure this out?

--Dean
 
J

Joe Smith

Dean said:
I am using ActiveState Perl on a Windows 2000 Professional machine.
Several weeks ago my Perl scripts stopped accepting arguments. @ARGV is
always empty!

Have you tested it from the command line?

C:\>perl -le "print qq(ARGV = '@ARGV');" foo bar
ARGV = 'foo bar'
 
J

jl_post

Thanks so much for your help. My registry is a little
different. I have no Perl key under HKEY_CLASSES_ROOT,
but I did find the line you site here:
[SNIP]

Do you have any further suggestions on how I could figure this out?

--Dean


Dear Dean,

I'd reccommend just trying what the other posters suggested. For
instance, it's unclear whether you can see @ARGV if you invoke the perl
interpreter directly, or you just can't see @ARGV ever. Running this
test will (hopefully) let us know:

perl.exe -le "print qq(ARGV = '@ARGV');" foo bar

If you get the result:

ARGV = 'foo bar'

then we know that you can see @ARGV, but somehow they're not getting
passed to the perl interpreter the usual way you run Perl scripts.

Could it be that maybe you're running perl.bat instead of perl.exe
without even knowing it? If the above test succeeded, try running it
again but without the ".exe" extension. Maybe multiple Perl
executables are somehow getting mixed up.

See if any of this helps. Hopefully you'll discover what's wrong.

-- Jean-Luc
 
D

Dean Hannotte

Thanks everyone for helping me with this. I finally solved the problem
by going to Windows Explorer / Tools / Folder Options / File Types. I
noticed that .pl files were considered to be type "Perl Script", and
that the program responsible for Perl Scripts was shown as

c:\Perl\bin\perl.exe %1

I changed this to

c:\Perl\bin\perl.exe %1 %*

as per your suggestions and my problem went away! (I still don't know
how this attribute got f*cked up, but not all mysteries are soluble it
seems....)

Dean Hannotte
http://www.hannotte.net
 
J

John Bokma

Dean said:
Thanks everyone for helping me with this. I finally solved the problem
by going to Windows Explorer / Tools / Folder Options / File Types. I
noticed that .pl files were considered to be type "Perl Script", and
that the program responsible for Perl Scripts was shown as

c:\Perl\bin\perl.exe %1

I changed this to

c:\Perl\bin\perl.exe %1 %*

Ko's post suggests that it has to be "%1", on XP I do see:

perl.exe "%1" %*
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,905
Latest member
Kristy_Poole

Latest Threads

Top