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

Re: [MacPerl] MacPerl bugs?



At 11:51 PM -0400 6/1/99, Scott Prince wrote:

} Hello all,
}
} I've run across a few things recently and am just wondering if anyone
} else has been bitten by these...
}
} $^O - I have a script and need to know if the platform is Mac or other:
}
} if ($^O =~ /mac/) { #.... }
} # then later on...
} $z = eval {/$x/};
} # but wait, eval no longer works!
} # removing the ($^O =~ /mac/) verified this.
}

eval always works for me, and since it's such an important part of Perl,
people would have noticed if it didn't work.  You're going to have to give
a real example, showing the code, telling us what you expected to happen,
and telling us what actually happened.  I'm guessing the eval actually
works somewhat differently than you think it does.

}
} scalar  - counting array elements:
}
} $_ = "a\tb\tc\t\t\t\n"; # read in from a database file
} @x = split (/\t/, $_);
} if (scalar (@x) == 6) { #... }
} # for Unix the number of elements is 6 (as expected)
} # for the Mac it is 3
} # MacPerl will not see the empty elements.

Not here it isn't:

$_ = "a\tb\tc\t\t\t\n"; # read in from a database file
@x = split (/\t/, $_);
print $^O." ".scalar @x."\n";

gives

MacOS 6


}
}
} Scott
}
} ===== Want to unsubscribe from this list?
} ===== Send mail with body "unsubscribe" to macperl-request@macperl.org



-----
Paul J. Schinder
schinder@pobox.com

===== Want to unsubscribe from this list?
===== Send mail with body "unsubscribe" to macperl-request@macperl.org