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

Re: [MacPerl-Toolbox] Mac::Glue ponderings



At 14.03 -0500 1999.03.12, Chris Nandor wrote:
>Unfortnately, precompiling the OSA script and storing it (in the file
>resource fork, for instance) is not a good option, because often there will
>be perl expressions passed to the scripts which would need to be evaluated
>at run time.

Although, now that I think of it, this could be done if you _know_ that the
script will not change.  You could do something like:

  $script_id = 130;
  if (script_id_exists_in_this_file($script_id)) {
    $script = load_script_from_this_file($script_id);
  } else {
    $script = construct_script();
    $script->save_in_this_file($script_id);
  }

That would speed up execution to be similar to that of the Apple Events
methods after the first execution, as long as you didn't mess with the
resource fork and remove the script data.  And if you rewrote the script to
be saved, you could wipe the data with ResEdit or a droplet or something.

--
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-toolbox-request@macperl.org