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

[MacPerl] works in macperl and in terminal mode on server, but not inbrowser



Please examine the following:


#!/usr/bin/perl
require ("cgi-lib.pl");

&ReadParse(*look);

###put this in here just to give it a variable to work with in debugging
when not passing a variable of ?st=whatever from the browser
$look{'st'} = "NEW YORK";
###end of test input

&PrintHeader;




open(in1,"att.db");
while (<in1>) {
chop;
($state,$city,$phone) = split(/:/,$_,3);
if ( (length($look{'st'}) > 2) && ($look{'st'} eq $state) ) {
$answer .= "$state\, $city\: $phone\n";
}
}
print $answer;
close (in1);


My database is as follows:
<SNIP>
NEW JERSEY:Pleasantville:609-383-0315
NEW JERSEY:Ridgewood:201-251-8561
NEW MEXICO:Albuquerque:505-242-7070
NEW YORK:Albany:518-447-0459
NEW YORK:Armonk:914-747-7100
NEW YORK:Bay Shore:516-968-6305
NEW YORK:Binghamton:607-724-9070
NEW YORK:Buffalo:716-853-0820
NEW YORK:Farmingdale:516-249-2948
NEW YORK:New York City:212-365-7884
NEW YORK:New York City:212-528-2420
NEW YORK:Piermont:914-398-3207
NEW YORK:Poughkeepsie:914-452-0038
NEW YORK:Riverhead:516-369-5079
NEW YORK:Rochester:716-454-1030
NEW YORK:Syracuse:315-448-4575
NEW YORK:White Plains:914-397-2300
NORTH CAROLINA:Asheville:704-232-5200
NORTH CAROLINA:Charlotte:704-376-2060
NORTH CAROLINA:Fayetteville:910-678-2036
NORTH CAROLINA:Greensboro:910-412-5880
NORTH CAROLINA:Raleigh:919-508-3000
</snip>


I get the following listing when run in term mode (or in macperl):  perl -w
att_lookup.pl

NEW YORK, Albany: 518-447-0459
NEW YORK, Armonk: 914-747-7100
NEW YORK, Bay Shore: 516-968-6305
NEW YORK, Binghamton: 607-724-9070
NEW YORK, Buffalo: 716-853-0820
NEW YORK, Farmingdale: 516-249-2948
NEW YORK, New York City: 212-365-7884
NEW YORK, New York City: 212-528-2420
NEW YORK, Piermont: 914-398-3207
NEW YORK, Poughkeepsie: 914-452-0038
NEW YORK, Riverhead: 516-369-5079
NEW YORK, Rochester: 716-454-1030
NEW YORK, Syracuse: 315-448-4575
NEW YORK, White Plains: 914-397-2300

Why do I get a server error when run from a browser?
I have set permissions to 755 on the program and 755 on the database just a
test..

try it:  http://www.jann.com/att/att_lookup.pl

In the future I will pass it either a 2-state locater (parsing that
separately) or the user can spell out the state.  This is just preliminary
code.


HELP!

Jann

**
Hate is NOT a "Family Value"!
professional site:  http://www.jann.com/
personal site:       http://www.jann.com/jann/
email:                  mailto:webmaster@jann.com
**



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