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

[MacPerl] Bug report on 5.14b1 (fwd)



According to Paul J. Schinder:
> sub import {
>     my $pkg = shift;
>     my $callpkg = caller;
	.
	.
	.
>     	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#;
	.
	.
	.
> 	    if($^O eq "MacOS") {
> 	    	my $mcalldir = ($calldir =~ s,/,:,g);
> 	    	$path = ":auto:$mcalldir:autosplit.ix";
> 	    } else {
> 	    	 $path ="auto/$calldir/autosplit.ix";
	.
	.
	.

Paul,

Not to ask a stupid question or anything....well - ok maybe
it is stupid.  ;-)  Anyway, is there some reason why "IBM"
isn't checked for on the OS's?  Shouldn't the above be:

	if($^O eq "MacOS") {
		my $mcalldir = ($calldir =~ s,/,:,g);
		$mcalldir = ":".$mcalldir;
		$path =~ s#^(.*)$mcalldir\.pm$#$1:auto$mcalldir:autosplit.ix#;
		}
		elsif( $^O eq "IBM" ){
			$path =~ s#^(.*)$mcalldir\.pm$#$1\\auto$mcalldir\\autosplit.ix#;
			}
		else {
			$path =~ s#^(.*)$calldir\.pm$#$1auto/$calldir/autosplit.ix#;
			}

Also, if you have a sec, can you explain why the "if( x eq
y )" is used in favor of the "if( x =~ y )"?  Is the former
faster than the latter?  Or just programming style?
Thanks!  :-)

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