__Disclaimer__ ***Sorry about the giant company disclaimer at the end***
I have a script (script follows signature) that works just fine when
executed at the command line (i.e. perl.exe fixnetrcname.pl).  I want to
make this an executable to distribute to systems that don't have Perl
installed, but when I run the compiled EXE, I get the error:
----------
     Can't call method "Clone" on an undefined value at Win32/TieRegistry.pm
line 146
     .
     BEGIN failed--compilation aborted at c:\temp\fixnetrcname.pl line 4.
----------
Here is the command line I used for PerlApp, along with the verbose output:
----------
     c:\perl\bin\perlapp.exe -s=c:\temp\fixnetrcname.pl -f
-e=fixnetrcname.exe -v -r
----------
     Input script name: c:\temp\fixnetrcname.pl
     Output exe name: fixnetrcname.exe
     Exe Mode: Freestanding
     Building Console mode exe
     Temp files will be kept on exit
     Failed 'use's will be reported
     Adding Module: c:/Perl/lib/Exporter.pm
     Adding Module: c:/Perl/lib/Carp.pm
     Adding Module: c:/Perl/site/lib/Win32/WinError.pm
     Adding Module: c:/Perl/lib/strict.pm
     Adding Module: c:/Perl/lib/vars.pm
     Adding Module: c:/Perl/lib/Config.pm
     Adding Module: c:/Perl/lib/warnings/register.pm
     Adding Module: c:/Perl/lib/warnings.pm
     Adding Module: c:/Perl/lib/DynaLoader.pm
     Adding Module: c:/Perl/lib/auto/DynaLoader/dl_expandspec.al
     Adding Module: c:/Perl/lib/auto/DynaLoader/dl_findfile.al
     Adding Module: c:/Perl/lib/auto/DynaLoader/dl_find_symbol_anywhere.al
     Adding Module: c:/Perl/lib/auto/DynaLoader/autosplit.ix
     Adding Module: c:/Perl/lib/Carp/Heavy.pm
     Adding Module: c:/Perl/site/lib/Win32API/Registry.pm
     Adding Module: c:/Perl/lib/Exporter/Heavy.pm
     Adding Module: c:/Perl/site/lib/Win32/TieRegistry.pm
     Adding Module: c:/Perl/lib/AutoLoader.pm
     Adding Module: c:/Perl/lib/Tie/Hash.pm
     Adding Module: c:/Perl/site/lib/Win32API/Registry/cRegistry.pc
     Adding Binary: c:/Perl/site/lib/auto/Win32API/Registry/Registry.dll
     Adding Binary: c:/Perl/site/lib/auto/Win32/WinError/WinError.dll
----------
I know I can just write the script with use Win32::Registry (instead of
Win32::TieRegistry), but the documentation from AS says that Win32::Registry
is obsolete, and that I should use Win32::TieRegistry.

Can somebody please help me out and let me know what I'm doing wrong, or
what I can do to fix this (other than re-writing it with use Win32::Registry
(which does work, btw).

Thanks,
Jason
----------
use warnings;
use strict;
my $Registry;
use Win32::TieRegistry (TiedRef => \$Registry, Delimiter=>"\\");

my $ComputerName =
$Registry->{"LMachine\\System\\CurrentControlSet\\Control\\ComputerName\\Com
puterName\\\\ComputerName"};
my $NetrcNameKey = $Registry->{"LMachine\\Software\\Funk Software,
Inc.\\Proxy Host\\Settings\\"};
my $NetrcName = $NetrcNameKey->{"Name"};

if ($NetrcName ne $ComputerName) {
  $NetrcNameKey->{"\\Name"} = $ComputerName;
} #end if
exit (0);
----------


CONFIDENTIALITY NOTICE:

************************************************************************

The information contained in this ELECTRONIC MAIL transmission
is confidential.  It may also be privileged work product or proprietary
information. This information is intended for the exclusive use of the
addressee(s).  If you are not the intended recipient, you are hereby
notified that any use, disclosure, dissemination, distribution [other
than to the addressee(s)], copying or taking of any action because
of this information is strictly prohibited.

************************************************************************

Reply via email to