At 02.26 +0000 1999.12.27, John Delacour wrote: >>That is very odd. The character "\001" does not exist in Mac::Glue, nor >>does the string "peffpwpc". And since these all appear to be on line 1, it >>seems that the file did not get translated from Unix to Mac text; > >It is a 1.7 Mb binary file beginning Joy!peffpwpc This is the file Glue.pm? I have no idea why it would be like that, it is completely wrong. It may be related to the problem mentioned below with @INC. >> so again, >>as noted above, it seems cpan-mac is the culprit. Either cpan-mac is not >>installed properly, or there is an old version installed. Along with >>checking the version of cpan-mac installed, could you tell me what the >>contents of @INC are? >> >> print join "\n", @INC; > >D8:Program Files:MacPerl Ÿ:lib:MacPPC: >D8:Program Files:MacPerl Ÿ:lib: >D8:Program Files:MacPerl Ÿ:site_perl:MacPPC: >D8:Program Files:MacPerl Ÿ:site_perl: >: >Dev:Pseudo: The cpan-mac instructions tell you to put site_perl in your prefs, so it comes before lib. This could be the cause of problems. Go into the prefs and add it, if you haven't already. >Part of the problem seems to have been caused by my dropping the expanded >folder onto installme rather than the tar.gz. At one point in the docs it >says either method will do and at another there is a clear warning to use >the compressed file. There should be no difference in the methods. What clear warning was there to use the compressed file? >I have now done a completely new install of MacPerl and this time there >were no problems installing cpan-mac or Mac Glue, but I'm still warned of >missing files when I install Mac-AppleEvents-Simple-0.81.tgz. Such warnings are sometimes the result of a poorly constructed MANIFEST file, which is the case here. No worries, it worked fine. >The few events I've tried using the new files seem to work fine, and the >files declared to me missing seem to be there, so maybe now things are all >right. > >Now a couple of simple questions. Take the script: > >use Mac::Glue; >my $obj = new Mac::Glue 'Eudora'; >$obj->activate; >$obj->connect; > > >When run from MacPerl, the loading of the library always takes several >seconds, no matter how often I run the script. It depends on the machine. On my PowerBook G3/292, it is about one second. >This is surprising to me after working with Script Editor, Frontier etc. >where once the script is compiled, it will thereafter run fast even from >the editor. Exactly. Perl doesn't precompile. With every Perl program, the program is compiled each time it is run. This is not the case with AppleScript and Frontier, which can save a script in a compiled state. Well, there is experimental support for that in perl 5.005, and that may someday work with MacPerl, but for now, you are stuck with "recompiling" every script you run, every time it is run. >and how do I actually get the selected text as text using the following event? > >use Mac::Glue; >my $obj = new Mac::Glue 'Eudora'; >$obj -> get (selected_text); >print "\n" ; print $obj; >#--> Mac::Glue::GLUE0=HASH(0x21db2ec) #!perl -w use Mac::Glue; $e = new Mac::Glue 'Eudora Pro'; print $e->get( $e->prop(selected_text => window => 1) ); See the Mac::Glue docs for object specifier records. >Is it possible to use the raw event codes rather than loading the library? What library? You mean, Mac::Glue? Sure, you can use Mac::AppleEvents or Mac::AppleEvents::Simple. I show some benchmarks for speed differences in the Mac::Glue docs. Merry Christmas, -- Chris Nandor mailto:pudge@pobox.com http://pudge.net/ %PGPKey = ('B76E72AD', [1024, '0824090B CE73CA10 1FF77F13 8180B6B6']) # ===== Want to unsubscribe from this list? # ===== Send mail with body "unsubscribe" to macperl-request@macperl.org