🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: pl.comp.lang.perl
Article #814

Re: PERL CGI Parsing

#814
From: Nick Djurovich
Date: Fri, 12 Dec 1997 16:32
60 lines
3081 bytes
Ruben Safir wrote:

> Hello
>
> Perhaps someone can help me with a CGI written in perl that I am
> working on.
>
> The script is taking data from a form which is user edited.  It
> is then
> parsed or decoded, then looked up on a database file called
> ussaf.txt.
> When a matching key is found, it is the entire database is copied
> record by record into a new file, with the changed information.
>   Then the newfile is renamed the old file.
>
> I seem to be having trouble with the two opened files.
> I am not being permited to open one file for reading

A common problem is that a CGI script being run by the webserver
normally has the USERID of 'nobody'. Or if not this, some other
userid that isn't the same group as the user (you). What this means
basically is that the permissions on the directory that you wish
to read and write from, have to have WORLD or OTHER access. I
suspect currently the CGI script hasn't permission to write to the
directory.
Do a man on chmod to get more info. Go to the directory where
you want to read/write to and type :

chmod o+rw .

This gives (r)EAD and (w)RITE access to the (o)THER
users ... which is basically any other id.


Hmmm ... why does it think DATAOUT is a subroutine. I thinkyou have a
syntax problem here. Are you sure you have opened
the FILEHANDLE correctly ? eg open( DATAOUT, "> filename" );Perhaps
because it couldn't open the file , this causes DATAOUT
to be undefined as a filehandle and so it thinks it's a subroutine.
Ideally, you should check the result of the open command, check,
and flag and error if there's a problem. Never assume anything ..
is a good motto.

/Nick

> Name:    Nicholas Djurovich
> E-Mail:  etlndh@etlxdmx.ericsson.se
> Phone:   (0)1444 23 4179
>
> Product Development Manager, Business Comms
> Ericsson Telecommunications Ltd.
> Burgess Hill, England
>
> Opinions : All or none of the opinions not expressed here
>            are not necessarily those of my own or of
>            anybody else that I don't know or haven't not
>            yet met.
>
> Disclaimer : I disclaim everything, I didn't do it, nobody
>              saw me, you can't prove anything.
Technical Details
Message-ID: <3491671D.B8348A63@etlxdmx.ericsson.se>
Path: mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!pingwin.icm.edu.pl!mat.uni.torun.pl!uw.edu.pl!news.icm.edu.pl!fu-berlin.de!pallol.usenet.co.uk!usenet.co.uk!rill.news.pipex.net!pipex!uunetukout!news.algonet.se!feed1.news.luth.se!luth.se!erix.ericsson.se!newstoo.ericsson.se!news
References: <OnL$e1ZB9GA.204@nih2naab.prod2.compuserve.com>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!pingwin.icm.edu.pl!mat.uni.torun.pl!uw.edu.pl!news.icm.edu.pl!fu-berlin.de!pallol.usenet.co.uk!usenet.co.uk!rill.news.pipex.net!pipex!uunetukout!news.algonet.se!feed1.news.luth.se!luth.se!erix.ericsson.se!newstoo.ericsson.se!news
From: Nick Djurovich <etlndh@etlxdmx.ericsson.se>
Newsgroups: comp.lang.perl.misc,comp.os.linux.networking,pl.comp.lang.perl,uk.comp.os.linux,alt.os.linux.slackware
Subject: Re: PERL CGI Parsing
Date: Fri, 12 Dec 1997 16:32:30 +0000
Organization: Ericsson Telecom, Burgess Hill, England
Lines: 63
Message-ID: <3491671D.B8348A63@etlxdmx.ericsson.se>
References: <OnL$e1ZB9GA.204@nih2naab.prod2.compuserve.com>
NNTP-Posting-Host: etlxd32c.ericsson.se
Mime-Version: 1.0
X-Mailer: Mozilla 4.03 [en] (X11; I; SunOS 5.6 sun4m)
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit