@ARGV vanished!

Discussion in 'Perl Misc' started by Dean Hannotte, Apr 29, 2005.

  1. 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


    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
    Dean Hannotte, Apr 29, 2005
    #1
    1. Advertising

  2. Dean Hannotte

    Guest

    Dean Hannotte wrote:
    >
    > 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
    , Apr 29, 2005
    #2
    1. Advertising

  3. 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
    Dean Hannotte, Apr 29, 2005
    #3
  4. Dean Hannotte

    Joe Smith Guest

    Dean Hannotte wrote:
    > 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'
    Joe Smith, Apr 30, 2005
    #4
  5. Dean Hannotte

    Guest


    >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
    , May 1, 2005
    #5
  6. 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
    Dean Hannotte, May 5, 2005
    #6
  7. Dean Hannotte

    John Bokma Guest

    Dean Hannotte wrote:

    > 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" %*

    --
    John Small Perl scripts: http://johnbokma.com/perl/
    Perl programmer available: http://castleamber.com/
    Happy Customers: http://castleamber.com/testimonials.html
    John Bokma, May 5, 2005
    #7
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. G. Völkl

    ASP 2: item from arraylist vanished ?!

    G. Völkl, Nov 18, 2005, in forum: ASP .Net
    Replies:
    1
    Views:
    350
    Karl Seguin
    Nov 18, 2005
  2. Ali
    Replies:
    2
    Views:
    350
    Prateeksha Web Services
    Dec 23, 2003
  3. Marvel
    Replies:
    16
    Views:
    589
    Marvel
    Mar 24, 2006
  4. netnatter

    Server Explorer vanished

    netnatter, Jun 23, 2008, in forum: ASP .Net
    Replies:
    2
    Views:
    277
    Cowboy \(Gregory A. Beamer\)
    Jun 23, 2008
  5. Massimiliano Mirra - bard

    GtkGlArea vanished?

    Massimiliano Mirra - bard, Jul 18, 2003, in forum: Ruby
    Replies:
    0
    Views:
    90
    Massimiliano Mirra - bard
    Jul 18, 2003
Loading...

Share This Page