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

Re: more info




as I read your explanation, it makes sense, but there is still nothing
being stuck in news.txt. i changed the path to relative from absolute to
make sure the file was being found, but no change. I double checked and
news.txt is perms 777.
I am not doing anything with the stdin before I am putting it into the
text file. Or I gues I should say, before I try to put it into the text
file.

:)

________________________
Lunar Media Incorporated
what a wicked web we weave
http://www.lunarmedia.net
1 . 8 0 0 . 2 5 2 . 8 2 2 1  

On Sun, 9 Apr 2000, Cloudmaster wrote:

> 
> Well, I guess what you really wanna do is open a file, and copy the data to
> the file, right?  My preference is:
> 
> $news = "/path/to/news.txt";
> open(FILEHANDLE, $news);
> while(<STDIN>){
> 	print FILEHANDLE $_;
> }
> close(FILEHANDLE);
> 
> That should read all the lines from STDIN and print them to the FILEHANDLE.
> There's obviously several other methods to do it, since this *is* perl.  
> For one thing, you can leave the STDIN out and just use "while(<>)" instead.
> 
> --Danny, who should've caught that the first time...
> 
> On Sun, 9 Apr 2000, Charles Menzes wrote:
> > I see your point. Thanks.
> > For some reason however, the input from the html form is still not being
> > placed with the news.txt file, which is 666 (perms that is :-)
> > 
> > Any thoughts on that? cjm
> > 
> > On Sun, 9 Apr 2000, cloudmaster wrote:
> > > Charles Menzes wrote:
> > > > 
> > > > $NEWS="/path/to/news.txt";
> > > > read (STDIN, $DATA, $ENV{"CONTENT_LENGTH"}) > $NEWS;
> > > > 
> > > > Shouldnt this just take data coming in from an html form with method=POST
> > > > and cat it into the specified file?
> > > 
> > > I think you may want
> > > read (STDIN, $NEWS, $ENV{'CONTENT_LENGTH'});
> > > 
> > > read takes a filehandle as the first argument, the variable to read into as
> > > the second, length as the third, and an optional fourth argument that's an
> > > offset (location in the variable to start writing, defaults to 0).
> > > 
> > > perldoc -f read
> > > gives a little better description, I got that out of my handy Perl5 pocket
> > > reference (which is *real* handy).
> > > 
> > > --
> > > To unsubscribe, send email to majordomo@springfield.pm.org
> > > with "unsubscribe pm-discuss" in the body.
> > > 
> > 
> > 
> > --
> > To unsubscribe, send email to majordomo@springfield.pm.org
> > with "unsubscribe pm-discuss" in the body.
> > 
> 
> 
> --
> To unsubscribe, send email to majordomo@springfield.pm.org
> with "unsubscribe pm-discuss" in the body.
> 


--
To unsubscribe, send email to majordomo@luci.org with
"unsubscribe luci-discuss" in the body.