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

[MacPerl] Bug report on 5.14b1



1. FindFolder.pl is missing its extra resources, including the XFCN.  I
guess that's why it doesn't work.  I assume simply copying the one in the
5.13 distribution will work fine?

2. rename() will no longer rename into the Trash for me.  It does still
seem to work renaming files in the Desktop folder, but I haven't tried any
other cross
folder renames.

3. IO::File I covered this morning.

4.  AutoLoader.pm still needs a little work, although it should work fine
almost  all the time.  Change number one is in the AUTOLOAD block, after
line 29:

       $name = undef unless (-r $name);
      }
     unless (defined $name)
      {
       if($^O eq "MacOS") {
       	$name = ":auto:$AUTOLOAD.al";
       	$name =~ s#::#:#g;
       } else {
        $name = "auto/$AUTOLOAD.al";
        $name =~ s#::#/#g;
       }
      }

The second change is to get sub import to  work.  Although I'm still a
little fuzzy on when it is actually used, after reading the docs for
AutoLoader it seems like it's a Good Thing for the autoload.ix files to be
used if they're there.  That means import has to be fixed, because it's
looking for / paths:

sub import {
    my $pkg = shift;
    my $callpkg = caller;

    #
    # Export symbols, but not by accident of inheritance.
    #

    Exporter::export $pkg, $callpkg, @_ if $pkg eq 'AutoLoader';

    #
    # Try to find the autosplit index file.  Eg., if the call package
    # is POSIX, then $INC{POSIX.pm} is something like
    # '/usr/local/lib/perl5/POSIX.pm', and the autosplit index file is in
    # '/usr/local/lib/perl5/auto/POSIX/autosplit.ix', so we require that.
    #
    # However, if @INC is a relative path, this might not work.  If,
    # for example, @INC = ('lib'), then
    # $INC{POSIX.pm} is 'lib/POSIX.pm', and we want to require
    # 'auto/POSIX/autosplit.ix' (without the leading 'lib').
    #

    (my $calldir = $callpkg) =~ s#::#/#;
    my $path = $INC{$calldir . '.pm'};
    if (defined($path)) {
	# Try absolute path name.
    	if($^O eq "MacOS") {
    		my $mcalldir = ($calldir =~ s,/,:,g);
    		$mcalldir = ":".$mcalldir;
    		$path =~ s#^(.*)$mcalldir\.pm$#$1:auto$mcalldir:autosplit.ix#;
    	} else {
    		$path =~ s#^(.*)$calldir\.pm$#$1auto/$calldir/autosplit.ix#;
	}
	eval { require $path; };
	# If that failed, try relative path with normal @INC searching.
	if ($@) {
	    if($^O eq "MacOS") {
	    	my $mcalldir = ($calldir =~ s,/,:,g);
	    	$path = ":auto:$mcalldir:autosplit.ix";
	    } else {
	    	 $path ="auto/$calldir/autosplit.ix";
	    }
	    eval { require $path; };
	}
	carp $@ if ($@);
    }
}

---
Paul J. Schinder
NASA Goddard Space Flight Center
Code 693, Greenbelt, MD 20771
schinder@pjstoaster.pg.md.us



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