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

[MacPerl] 5.1.4 notes



1) it comes with Shuck 1.0


the immediate reason I wanted to try this version was because I know from
experience with the UNIX version that 5.004 is much better at reporting
errors, and I was reminded of this when I wasted two hours the other day
locating a subroutine call which was missing a parameter. I would have
kicked myself, except I had made the effort to have the correct prototype
in scope.


2) [not new with 5.1.4] how should I use StandardFile
  #!perl -w
  use  strict;
  require  "StandardFile.pl";
  my $fpath;
  $fpath = StandardFile::GetFile("the db change file", $fpath);
  printf $fpath;
produces the following warnings:
  # Use of uninitialized value.
  File 'Danny Scratch:MacPerl Ä:lib:StandardFile.pl'; Line 42
  # Use of uninitialized value.
  File 'Danny Scratch:MacPerl Ä:lib:StandardFile.pl'; Line 48
<I selected file here and it prints out path>
  Danny Scratch:Download:t.pm

Similarly I've seen the following warnings from 5.1.4b1
  # Argument "GUSI::CHOOSE_DEFAULT" isn't numeric in entersub.
  File 'More Schtuff:MacPerl Ä:lib:StandardFile.pl'; Line 48
  # Argument "GUSI::CHOOSE_DEFAULT" isn't numeric in entersub.
  File 'More Schtuff:MacPerl Ä:lib:StandardFile.pl'; Line 48


3) doing a Syntax check of one of my modules seems to cause a System
problem, but unfortunately it got worse (a freeze) when I restarted with
MacsBug 6.5.4a1 (on a 7300/7.6.1). Actually this was a memory problem, and
the syntax check completed on increasing the memory partition to my usual
12M. Is this version supposed to be any more robust in the face of
exhausting memory?


4) Although I had been running strict previously I was pleasantly surprised
to find very few errors were reported in a syntax check of my modules.
There were a few cases I'd declared variables more than once. There were
two other types

4a) it may have been as a result of bugs in preceding versions, or at least
my assumption that a my variable declared at the start of a loop is
initialized on each pass through the loop, but there were a few places I
was trying to clear a hash. 5.1.4 says that
   %f = {};
hash has an odd number of elements. So changing that to
   %f = ();
seemed to quieten it down. Can someone explain this?


4b) how should I use the Exporter module?
My modules normally start like so
  #!perl -w
  package  Sapphire;
  require Exporter;
  @ISA = Exporter;
  @EXPORT = qw( .... );
  use  strict;
However if I move the strict immediately after the shebang, I get warnings
like these:
  # Global symbol "ISA" requires explicit package name.
  File 'Danny Scratch:Download:t.pm'; Line 5
  # Bareword "Exporter" not allowed while "strict subs" in use.
  File 'Danny Scratch:Download:t.pm'; Line 5
  # Global symbol "EXPORT" requires explicit package name.
  File 'Danny Scratch:Download:t.pm'; Line 6
  # Execution of Danny Scratch:Download:t.pm aborted due to
    compilation errors.
Presumably this is not MacPerl specific, but I can't say I've ever mastered
packages or OO coding. Is there a better way?


5) I noticed one of my scripts was failing when it tried cal FindFolder.
I've tried it on a fresh install of 5.1.4b1, and tried t:Mac:FindFolder.t
which gave a similar error:
  # MacPerl::LoadExternals("FindFolder.pl"): File not found..
  File 'Danny Scratch:MacPerl Ä:lib:FindFolder.pl'; Line 3

NB MacPerl seems to update the path to the lib folder to be that of the
currently running MacPerl. That's smart because I might have forgotten to
do that manually.


cheers,
Danny Thomas



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