I'm sorry not to have pointed out, I didn't just take the script above and try to run it as a CGI.
I printed a valid header and used CGI::Carp and that didn't help. It still died silently at the line noted.
Here's a script which works in the command-line and not in the browser:
#!/usr/bin/perl
use CGI::Carp qw(fatalsToBrowser);
print "Content-type:text/plain\n\n";
require Mac::AppleScript::Glue;
print "started\n";
my $BB = new Mac::AppleScript::Glue::Application('BBEdit')
|| die "$!";
print "success creating Applescript Glue App object\n";
my $results = $BB->check_syntax(file =>
'path:to:file')
|| die "$!";
print "success checking syntax\n";
It gets as far as the first success message, and then, if the file exists, just stops.
If I try it on a file which doesn't exist, then yes, I get a failure from AppleScript and CGI::Carp does its thing. But if there is a file at that location, then it just stops.
What can I investigate in terms of permissions?
($_='kkvvttuubbooppuuiiffssqqffssmmiibbddllffss')
=~y~b-v~a-z~s; print
-
Are you posting in the right place? Check out Where do I post X? to know for sure.
-
Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
<code> <a> <b> <big>
<blockquote> <br /> <dd>
<dl> <dt> <em> <font>
<h1> <h2> <h3> <h4>
<h5> <h6> <hr /> <i>
<li> <nbsp> <ol> <p>
<small> <strike> <strong>
<sub> <sup> <table>
<td> <th> <tr> <tt>
<u> <ul>
-
Snippets of code should be wrapped in
<code> tags not
<pre> tags. In fact, <pre>
tags should generally be avoided. If they must
be used, extreme care should be
taken to ensure that their contents do not
have long lines (<70 chars), in order to prevent
horizontal scrolling (and possible janitor
intervention).
-
Want more info? How to link
or How to display code and escape characters
are good places to start.
|