Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re^6: unpacking wmic command's unicode output

by ikegami (Patriarch)
on Nov 12, 2008 at 19:48 UTC ( [id://723280]=note: print w/replies, xml ) Need Help??


in reply to Re^5: unpacking wmic command's unicode output
in thread unpacking wmic command's unicode output

I ran your exact script and got the right result.

>ARGVtest.pl $VAR1 = []; -1

I think your system's handling of .pl files is broken.

  1. First, get the file type from the default key of HKEY_CLASSES_ROOT\.pl. For me, it's "Perl".
  2. Then, set the default key of HKEY_CLASSES_ROOT\Perl\shell\Open\command to "c:\perl\bin\perl.exe" "%1" %* (where "Perl" is the file type from the first step).

As a .reg:

Windows Registry Editor Version 5.00 [HKEY_CLASSES_ROOT\.pl] @="Perl" [HKEY_CLASSES_ROOT\Perl] @="Perl File" [HKEY_CLASSES_ROOT\Perl\shell] [HKEY_CLASSES_ROOT\Perl\shell\Open] [HKEY_CLASSES_ROOT\Perl\shell\Open\command] @="\"c:\\perl\\bin\\perl.exe\" \"%1\" %*"

Replies are listed 'Best First'.
Re^7: unpacking wmic command's unicode output
by goibhniu (Hermit) on Nov 12, 2008 at 20:41 UTC

    Curiouser and curiouser . . .

    My HKCR\PerlScript\Shell\Open\Command is:
    C:\strawberry-perl\perl\bin\perl.exe "%1" "%*"

    I don't have HKEY_CLASSES_ROOT\Perl

    update: I took off the quotes around the %* and got your predicted results leaving me only with the $#ARGV vs. scalar(@ARGV) bug. THANKS and ++!


    #my sig used to say 'I humbly seek wisdom. '. Now it says:
    use strict;
    use warnings;
    I humbly seek wisdom.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://723280]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others browsing the Monastery: (3)
As of 2024-04-25 12:01 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found