[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

[MacPerl] Module installation question & InternetConfig.pm



Hi,
  I recently installed MacPerl 5.1.9r4 on a PowerMac 8600.  From what I recall
it was a standard PowerMac install from the distribution files from sunsite.

  While reviewing the cgi and network chapters of the MacPerl book I decided
to try out one of the examples as a starter and then proceed to rewriting a
bunch of my unix-style perl4 scripts to work with perl5.  I haven't gotten that
far.

  I typed in... (and yes, we do have a 'www' hostname reference that works!)

#!perl -w
#
use Net::Time qw(inet_daytime);
my($time);

$time = inet_daytime('www');
$time =~ s/[\015\012]//g;

print "$time\n";

  and tried to run it..... This is what I got....

# Ambiguous use of {index} resolved to {"index"}.
File 'Tremas:MacPerl Ä:lib:Mac:InternetConfig.pm'; Line 501
# Ambiguous use of {index} resolved to {"index"}.
File 'Tremas:MacPerl Ä:lib:Mac:InternetConfig.pm'; Line 503
# Ambiguous use of {index} resolved to {"index"}.
File 'Tremas:MacPerl Ä:lib:Mac:InternetConfig.pm'; Line 509
# Use of uninitialized value.
File 'Tremas:MacPerl Ä:lib:Mac:Types.pm'; Line 68
# Use of uninitialized value.
File 'Tremas:MacPerl Ä:lib:Mac:Types.pm'; Line 68
# Use of uninitialized value.
File 'Tremas:MacPerl Ä:lib:Mac:Types.pm'; Line 68
# Use of uninitialized value.
File 'Tremas:MacPerl Ä:lib:Mac:Types.pm'; Line 68
# Use of uninitialized value.
File 'Tremas:MacPerl Ä:lib:Mac:Types.pm'; Line 68
# Use of uninitialized value.
File 'Tremas:MacPerl Ä:lib:Mac:Types.pm'; Line 56
# Use of uninitialized value.
File 'Tremas:MacPerl Ä:lib:Mac:Types.pm'; Line 56
Tue Mar 10 17:21:28 1998
# Use of uninitialized value during global destruction.


Ok... so we take a look at InternetConfig.pm and there's three references
to {index} which we recall somewhere is a keyword in all lowercase, so we
modify that file to use {icindex} instead, which eliminated the problems
with InternetConfig.  We look at Types.pm and it appears that these lines
are "closures" that remember state... and we presume the warnings are being
generated by something calling one of the routines in Types.pm instead of
something that we can track down easily.

##    [InternetConfig.pl] [package Mac::InternetConfig::_Map]
##    sub FIRSTKEY {
##       my($my) = @_;
#501>    $my->{index} = 0;
#503>    return scalar(ICGetIndMapEntry($ICInstance, $my->{entries}, $my->{index}));
##    }
##    sub NEXTKEY {
##       my($my) = @_;
#509>     return scalar(ICGetIndMapEntry($ICInstance, $my->{entries}, ++$my->{index}));
##    }

##    [Types.pm]
##    sub _Unpacker {
##        my($template) = @_;
#56>      return sub { return unpack($template, $_[0]); };
##    }
##    sub _UnpackPStr {
##        my($string) = @_;    
#68>      return "" unless length($string);
##        my ($length, $cstr) = unpack("Ca*", $string);
##        return substr($cstr, 0, $length);
##    }

My real question is about the installation.  Did I somehow get the Macperl
files installed improperly?  I can't believe that this is the expected
behavior, and I can't believe that I'm the only one who has done a clean
install of MacPerl recently and ran across this problem.  H*LP!

-Carl

This same snippet saved as 'time.acgi' produces similar output on the web
server.  The date-time IS printed, so the script works.  But somehow I
would not expect the warning messages.  Looks like all of MY variables are
defined and initialized.  I suspect it's a package problem.  ;-(

PS: I'll take my comments on the reviewed chapters offline via email to the
    appropriate authors... after I verify that I still have the latest
    revisions.  (Unless someone wants to discuss them here).



Carl A Baltrunas <carl@reststop.com> and Cherie Marinelli <2bunnies@1unique.com>
Catalyst Industries: The One-Stop Internet registration and distribution service
URL: <http://www.reststop.com>    INFO: info@1unique.com
-owned by EWBR & EWBR-ette [our house bunnies] and Czazu [our dog]
 Visit them at their hotel at http://www.reststop.com/info/bunny/bunnycam.html



***** Want to unsubscribe from this list?
***** Send mail with body "unsubscribe" to mac-perl-request@iis.ee.ethz.ch