Good afternoon,
On 2/05/10 at 6:12 PM -0700, Jerry Krinock <[email protected]> wrote:
My favorite BBEdit feature is the ability to access documents on FTP
servers in the File menu. But syntax checking is broken for perl
scripts if they have 'use' directives other scripts on the server. It
quits with "Can't find in INC...".
Your script is "use"ing modules you don't have installed
locally. You either need to install the modules locally (you can
use CPAN for that) or do a syntax check on the server.
I believe the reason is that BBEdit makes a local copy of the file in
a temporary directory. If I start to open the 'used' files from the
server also, then the error changes to "Can't find" a different file,
and often I end up needing a perl file which I don't have access to
because I use a shared web host. Opening 25 files to do a syntax
check wouldn't be any fun anyhow.
Opening all the used files from the server won't work and is a
sure path to madness. I suggest just doing the syntax check on
the server. You won't get BBEdit's friendly error browser, but
at least you'll know whether the script compiles cleanly. And
that's what you really want to know anyway. Just because the
script compiles cleanly locally doesn't mean it will compile the
same on the server.
To check scripts on the server (assumes you have ssh or similar access)
$ perl -c path/to/script.pl
And if you've got access via ssh, you could create a local
shortcut using something like:
$ ssh u...@host perl -c path/to/script.pl
And I think that output could be passed to BBEdit to create an
error browser, but I don't recall details for doing that.
Is there any way to tell BBEdit's perl syntax checker to ignore 'use'
directives or something? I tried the #bbpragma but that seems to be
only for HTML.
Nope, you can't ignore them. If you don't "use" the the needed
modules the script won't be able to compile. Note, it's not
BBEdit that's doing the syntax check; it's perl doing the heavy
lifting. BBEdit is just automating that process for you and
giving you a friendly 'syntax ok' dialog or an error browser.
Charlie
--
Ꮚ Charlie Garrison ♊ <[email protected]>
O< ascii ribbon campaign - stop html mail - www.asciiribbon.org
〠 http://www.ietf.org/rfc/rfc1855.txt
--
You received this message because you are subscribed to the
"BBEdit Talk" discussion group on Google Groups.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/bbedit?hl=en
If you have a feature request or would like to report a problem,
please email "[email protected]" rather than posting to the group.