I've just discovered Andreas Marcel Riechert's TEC.pm which uses Apple Events to the
TEC osax to convert between character sets, eg:
use Mac::TEC;
$_ = '³Ô²';
$_ = Mac::TEC::ConvertText($_,'macintosh', 'windows-1252');
print "$_$/";
I have a couple of simple questions as a result, though not directly related to the
module.
1. Why in the above script and simliar scripts using different modules, is it
necessary for me to repeat Mac::TEC in the third line when the module is already
explicitly included?
2. The ConvertText subroutine needs to built an Apple Event and send it, so obviously
there is a delay. However, suppose I were to loop through chunks in a file converting
as I went, would the AE need to be compiled at every iteration or are all such things
compiled once and for all at run time? In other words will I have to wait only before
the first iteration and therafter be working with a faster, precompiled piece of kit?
3. Would it be possible with pure MacPerl, without the intermediary of an osax and
Apple Events to perform the same operations? I presume -- nay I trust to HEAVEN! --
that the Text Encoding Converter and all Apple's other delaying ploys are redundant in
MacOS X, but while I save up for my G4 and read all the OSX bug reports.....
JD