RE: Printing a file from the print statement
That is not working because $cardbody is reading the text between the markers as plain text, not processing commands. Try this instead and see how it works for you. open(OUTFILE,">>$FILE_NAME"); # >> means append to the end # of the file. If you want to # overwrite the contents, use # a single > instead. open(TEXT,") { print OUTFILE "$_ "; # We want to print to the file # rather than STDOUT } close(TEXT); # Close the read file close(OUTFILE); # Close the write file - Scot Robnett inSite Internet Solutions [EMAIL PROTECTED] http://www.insiteful.tv -Original Message- From: Sir Douglas Cook [mailto:[EMAIL PROTECTED]] Sent: Friday, February 22, 2002 1:52 PM To: [EMAIL PROTECTED]; [EMAIL PROTECTED] Subject: Printing a file from the print statement How can I make the "Open File and print content statements" work from my sub make_body when called from sub create_file? The output I get is open message.txt; while () { = "." } print The contents of message.txt is Hello this is a message The output I want is Hello this is a message The problem is how do I get this to work sub make_body { $cardbody =<<__END_OF_CARD_BODY__; open TEXT, "message.txt"; while () { print "$_"; } close TEXT; __END_OF_CARD_BODY__ } The way I print the make_body function #Write out our HTML FILE sub create_file { open(OUTFILE,">$FILE_NAME") ; print OUTFILE "$cardbody\n"; close (OUTFILE); } --- Incoming mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.324 / Virus Database: 181 - Release Date: 2/14/2002 --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.324 / Virus Database: 181 - Release Date: 2/14/2002 -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
permissions question
I have a pipe delimited text file in which I am collecting form submissions. I have the permissions currently set to 666. The problem is that if someone can figure out the path the .txt file, they can view it from their browser. I do not want this to happen. After a period of time, I am planning to ftp into the server and grab the .txt file to use the addresses for a mailing. What permissions should I use in order to have people write to the database from my form in their browser, but not view the text file from their browser? Thanks, Andrew -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: permissions question
I can see how that would be ideal. However, I am not able to do that at this time. Short of keeping it outside of a web server, what security precautions (including permissions 666 etc.) could I take to keep people from viewing the text file from the browser. Thanks, Andrew -Original Message- From: Lisa Nyman [mailto:[EMAIL PROTECTED]] Sent: Monday, February 25, 2002 8:58 AM To: Hughes, Andrew Subject: Re: permissions question Hi, Any sort of data file should be maintained outside of web server space with permissions that allow the web demon to access it in the manner it needs to. Your CGIs can get to the file but web browsers can't. Lisa Wolfisch Nyman <[EMAIL PROTECTED]> IT Warrior Princess "Life is too short to wear ugly underwear." Get the facts at http://quickfacts.census.gov/ -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: permissions question
>>I can see how that would be ideal. However, I am not able to do that at >>this time. Short of keeping it outside of a web server, what security >>precautions (including permissions 666 etc.) could I take to keep people >>from viewing the text file from the browser. how about giving the file an extension that cant be view by the browser without passing by the server. i'm very new to perl, but on a windows NT server, i would give the file an extension .asp. this file would apper blank to any one trying to download the file. there might be something with perl to let you do this. hope this helps Tim -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: permissions question
Andrew, If your web-server is set up correctly, then no files in the cgi-bin should be able viewable. I have .txt files in my cgi-bin, but if I try to view them with a browser, I get a "No such file or directory" error. Even if I try to ftp://mysite.com/cgi-bin/file.txt I still can't see it. Have you tried to access plain text files in your cgi-bin through your browser, and can you see them? If so, it might be worth askng your hosts if they can secure the cgi-bin in this way. (Unfortunately, I can't give any advice on how to set up a web-server to do this) Carl -- >From: "Hughes, Andrew" <[EMAIL PROTECTED]> >To: "'[EMAIL PROTECTED]'" <[EMAIL PROTECTED]> >Subject: permissions question >Date: Mon, Feb 25, 2002, 1:36 pm > > I have a pipe delimited text file in which I am collecting form submissions. > I have the permissions currently set to 666. The problem is that if someone > can figure out the path the .txt file, they can view it from their browser. > I do not want this to happen. After a period of time, I am planning to ftp > into the server and grab the .txt file to use the addresses for a mailing. > What permissions should I use in order to have people write to the database > from my form in their browser, but not view the text file from their > browser? > > Thanks, > Andrew > > -- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
sql question
this question seems to be unrelated to perl but merely sql. but i am generating a web page displaying the data from oracle db, using perl script..i have one problem though with my SQL.. can somebody pls. help me with sql on how to page the resultset from a select query... say page 1 contains first 1-100 rows, page 2 is 101-200 rows...and so on. i need to make a page toolbar with links to each page in a resultset similar to this: 1 2 3 4 5 6 7 8 9 any help would be appreciated... polix -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: sql question
Donn wrote: > this question seems to be unrelated to perl but merely sql. that's right. you'd probably be better off posting to a more appropriate forum. this page has several for oracle: http://www.faqs.org/faqs/databases/oracle-faq/ > can somebody pls. help me with sql on how > to page the resultset from a select query... > say page 1 contains first 1-100 rows, page 2 is 101-200 rows...and so on. > > i need to make a page toolbar with links to each page > in a resultset similar to this: > > 1 2 3 4 5 6 7 8 9 my oracle is a little rusty, but in postgresql i'd use something like: select * from foo limit 100 offset 0 and that will select the 1st 100 records, then you just adjust the 'offset' to get previous or next group of records. if you can't do that in oracle then you'll probably have to create a cursor. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Uploading a file?
Does anyone know how to upload a file to your site? -Rob - Do You Yahoo!? Yahoo! Sports - Coverage of the 2002 Olympic Games
@INC question
I just installed a new package from the net, sarge, to graph sar data. The package requires few modules to be installed. GD is one of them. Here is the output from perldoc: $ perldoc perllocal User Contributed Perl Documentation PERLLOCAL(1) Wed Feb 13 16:52:48 2002: "Module" GD::Graph o "installed into: /usr/local/lib/perl5/site_perl/5.6.1" o "LINKTYPE: dynamic" o "VERSION: 1.33" o "EXE_FILES: " When I run the program, here is what I get: # /admin/sarge_v0.53/httpdocs/bin/sarge.ustuld_1 Can't locate loadable object for module GD in @INC (@INC contains: /usr/local/lib/perl5/5.6.1/sun4-solaris /usr/local/lib/perl5/5.68 Compilation failed in require at /admin/sarge_v0.53/sarge line 8. BEGIN failed--compilation aborted at /admin/sarge_v0.53/sarge line 8. Line 8 says: use GD Any assistance is appreciated. Eddie
Server Error on duplicate file
Hello all, I have a Perl CGI script in the cgi-bin directory that works just fine. I have copied it to a file in the same directory with a different name, but everything else is the same - The text is the same, the permissions are the same. However, if I change the line in the calling HTML from old.cgi to new.cgi, I get a 'File Not Found' error. CGI test ...this works fine CGI test ...this errors out Any ideas as to what might cause this? I have re-copied and renamed and reset the perms multiple times. I have restarted the connection and stopped and started the browser each time. Nothing I do helps. AtDhVaAnNkCsE Robert Becker Programmer/Analyst Carroll College Waukesha, Wisconsin [EMAIL PROTECTED] -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Server Error on duplicate file
Robert Becker wrote: > I have a Perl CGI script in the cgi-bin directory that works just fine. I > have copied it to a file in the same directory with a different name, but > everything else is the same - The text is the same, the permissions are > the same. However, if I change the line in the calling HTML from old.cgi to > new.cgi, I get a 'File Not Found' error. > > CGI test ...this works fine > CGI test ...this errors out > > Any ideas as to what might cause this? I have re-copied and renamed > and reset the perms multiple times. I have restarted the connection and > stopped and started the browser each time. Nothing I do helps. try it with a leading slash in your links: CGI test -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Uploading a file?
Rob Roudebush wrote: > Does anyone know how to upload a file to your site? perldoc CGI and search for the description of the upload() method. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]