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

Re: [MacPerl] BBEdit as a text editor



At 9:13 pm +0100 15.12.97, Russell Aminzade wrote:
> ... I get the feeling that it's gotten easier to
>use BBEdit as a text editor for MacPerl.

Yep. BBEdit's syntax colouring for MacPerl is a big help and is much better
in recent versions. The only problem is that single quotes (as for instance
in $', or when a quote appears on its own as part of a regular expression)
tend to cause it to assume that everything that follows is a string, thus
dyeing large parts of your code bright pink.

>So exactly which BBEdit extensions and other stuff do I need to use ...

The BBEdit/MacPerl extensions are available from:

	http://members.aol.com/BradH5/bbedit/perl_ext_manual.html

> ... are there any tips or tricks I need to know.

Generally, no. These extensions are what we in the profession call 'pretty
damn cool'. The only minor problem is that when you use the 'Run Script'
command, it's seen by MacPerl as originating from '<AppleEvent>', rather
than from the actual file. This means that if your code depends on knowing
the pathname of the script file (for example, in order to locate preference
files etc., or if you refer to a file located in the same directory as the
script file by simply giving its filename), you'll probably get an error.
This can easily be avoided by using the 'Run File' rather than the 'Run
Script' command.

>Ideally, I'd like to be able to syntax-check from inside BBEdit, and gosh,
>maybe even save as a CGI.

The former is possible, the latter - as far as I know - is not. You may be
able to get round this by using AppleScript to tell MacPerl to save a file
as a specific type (and putting the AppleScript in BBEdit's Scripts menu).
I actually have a 'MakeDroplet' AppleScript which does something similar,
and which I can make available if anyone's interested. The only problem is
that to save the file, you first have to open it in MacPerl. If the file is
more than 32K in size, MacPerl will pop up a dialog saying that it can't
open the file, but it will be happy to save it for you in some esoteric
format. The appearance of this dialog tends to throw a spanner in the works
as far as driving things smoothly from AppleScript is concerned.

This, at least, was the state of affairs last time I investigated the
problem, but things may have changed since.

>Oh, and will it work with lite (some places I work don't have the non-free
>variety).

The Perl palette (a floating palette giving access to the commands) and the
'Edit MacPerl Script' extension only work with BBEdit. The other five
plug-ins, which implement the major functionality of the package, work fine
with Lite (or so says the author, at least, and I have no reason to
disbelieve him).

If you're running MacOS 8, you might also be interested (plug plug plug) in
the Shuck Contextual Menu plug-in from:

  http://pobox.com/~angus/Computing/Systems/Macintosh/Programs/CMMPlugins/

which I now see is almost painfully redundant, given that Brad Hanson's set
of BBEdit plug-ins also support Shuck calls from within BBEdit.

	A

--
angus@pobox.com                                   http://pobox.com/~angus/

 "The Paris slums are a gathering place for             George Orwell
  eccentric people - people who have fallen           "Down and out in
  into solitary half-mad grooves of life, and          Paris and London"
  given up trying to be normal or decent."



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