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

Re: [MacPerl] GUSI, as documented in Shuck, does not work?



At 05.40 98.01.16, Matthias Ulrich Neeracher wrote:
>>Here's the code snippet:
>>
>>>if ($mac) {
>>>      require "GUSI.ph";
>>>      $fileName = MacPerl::Choose(
>>>              GUSI::AF_FILE, 0, "",
>>>              GUSI::pack_sa_constr_file("", "TEXT"));
>>>}
>
>Nowadays, Perl does more compiling than it used to, so the procedures are not
>yet visible when they are called (that is why usually, "use" is used.
>
>Prefix the two GUSI:: procedures with a & and it will work.

Or, just add () to GUSI::AF_FILE.  Yesterday Randal Schwartz and Tom
Christiansen were arguning about this ... & circumvents prototypes and also
allows access to any subroutine name, like &if.  Tom thinks this is bad,
Randal thinks it is good.  I tend to go along with Tom on this.  Randal
contended that & is good for beginners who don't need prototypes anyway and
might mistakenly use a subroutine name that is reserved; but I think that
good programming practice begins as early as possible.

Back to your regularly scheduled sermon ...

--
Chris Nandor               pudge@pobox.com           http://pudge.net/
%PGPKey=('B76E72AD',[1024,'0824 090B CE73 CA10  1FF7 7F13 8180 B6B6'])
#==                    MacPerl: Power and Ease                     ==#
#==    Publishing Date: Early 1998. http://www.ptf.com/macperl/    ==#



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