Cody Pendant has asked for the wisdom of the Perl Monks concerning the following question:
So then I had what I thought was a brilliant idea -- BBEdit has a validator, BBEdit is scriptable via AppleScript; I'll use BBEdit as the back end and cut out all the hassle.
This script works just fine from the command line:
So then I tried it as a CGI script and it totally dies at the commented line above, "# if it worked...".#!/usr/bin/perl use strict; use Mac::AppleScript::Glue; use LWP::Simple; print "Enter URL:\n -> "; my $URL = <STDIN> || die "$!"; getstore( $URL, "/path/to/tempfile.html" ) || die; my $BB = new Mac::AppleScript::Glue::Application('BBEdit') || die "$!"; my $results = $BB->check_syntax( file => "path:to:tempfile.html" ) || die "$!"; # If it worked, $results is now # an AoH-type data structure foreach my $item ( @{$results} ) { print 'Line ' . $item->{'result_line'} . ': ' . $item->{'message'} . "\n"; }
When run from he command line, it works fine.
When run from the browser, it gives no output beyond that point.
I tried to wrap it with an eval{} but it still died.
Any ideas? Any reason why it should run fine from the command line but fail when run from the browser? What should I try or troubleshoot?
($_='kkvvttuubbooppuuiiffssqqffssmmiibbddllffss')
=~y~b-v~a-z~s; print
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Mac::AppleScript::Glue in CGI script
by tachyon (Chancellor) on Nov 13, 2004 at 05:21 UTC | |
by Cody Pendant (Prior) on Nov 13, 2004 at 08:44 UTC | |
by saberworks (Curate) on Nov 13, 2004 at 09:13 UTC | |
by tachyon (Chancellor) on Nov 13, 2004 at 09:49 UTC | |
|
Re: Mac::AppleScript::Glue in CGI script
by brian_d_foy (Abbot) on Nov 13, 2004 at 17:02 UTC | |
by Cody Pendant (Prior) on Nov 13, 2004 at 20:45 UTC | |
by tachyon (Chancellor) on Nov 13, 2004 at 21:58 UTC | |
|
Re: Mac::AppleScript::Glue in CGI script
by Fletch (Bishop) on Nov 13, 2004 at 14:28 UTC |