Re: Storing hashes & array's on disc

2001-06-26 Thread Timothy Kimball
: I'm looking for the best way to store an array or hash in a file on disc, : so it can be picked up by another cgi. : : I'm currently storing to a file where every line contains an element : (and I know that every 6 lines contain a column in my array). But I find : this rather...hmmmnot so

Re: ? embed scalars in the sql

2001-06-25 Thread Timothy Kimball
: Is it possible to embed a scalar into the sql such that the value of : the scalar could represent a column name to report or a value to : select by Sure. The query's just a scalar string until you execute it. Same goes for order by, group by, table names, or whatever. Just do yourself a favor

Re: refresh

2001-06-25 Thread Timothy Kimball
: I want to continuously refresh or update a screen with out it adding onto it's self. : Any ideas? Use the HTTP "refresh" header, either in the HTTP header: # I assume you're using CGI.pm print STDOUT header( -refresh => "1; $url_of_this_cgi_script", ); or in the HTML as a "meta" tag

Re: Running uxix commands through web.

2001-06-22 Thread Timothy Kimball
Oscar Rodriguez wrote: : > If I use : > : > system ls; : > : > My major problem is the way the data is shot back at the screen : > since it is not html and there are no 's after each line Try backticks in a list context: my @lines = `ls`; print "$_" for @lines; or, elimi

Re: trouble with sending form input through encrypted email using Crypt::GPG

2001-06-22 Thread Timothy Kimball
[EMAIL PROTECTED] wrote: : I am writing a script that takes form input and encrypts it using Crypt::GPG, : and emails it using Mail::Sendmail. I am using CGI::Param as my parser. : Here is my problem. I am able to run the script fine from the shell, but : am unable to run it through Apache. Th

Re: untaining data

2001-06-22 Thread Timothy Kimball
Curtis Poe wrote: : How do you know if the untainting succeeded? Since you are assinging back to the :same variable : (unless you have an else that you didn't show us). I like to assign to a 'dirty' :variable and : then untaint to a clean one. This is a lot safer. If a maintenance programme

Re: Writing to a text file

2001-06-22 Thread Timothy Kimball
Geraint Jones wrote: : I'm stuck! I want to write to a text file through a CGI script in : append/truncate mode, but every time I am told I don't have permission. I'm : running Linux, I've changed ownership and group to nobody and nogroup to no : avail. A few thoughts: * Is the file writable

Re: untaining data

2001-06-22 Thread Timothy Kimball
Alen Sarkinovic wrote: : I'm using this format for untaining data : : : if ($data =~ /^([-\@\w.]+)$/) { : $data = $1; : : but , I would like to alow char : + ,and ,char : space , to be entered into the :$data : What code will do that? Just add + and \s to the list (you don't need to ba

Re: Extra ?

2001-06-21 Thread Timothy Kimball
Mel Matsuoka wrote: : >Randal L. Schwartz wrote: : >: ... : >: Second might mean something like: : >: : >: $foo_length = SOME_LIST # although this can't happen : >: = list : >: = assigned to : >: === scalar : >: : >: See the differ

Re: Extra ?

2001-06-21 Thread Timothy Kimball
Randal L. Schwartz wrote: : ... : Second might mean something like: : : $foo_length = SOME_LIST # although this can't happen : = list : = assigned to : === scalar : : See the difference? And the latter can't happen. Sure it can.

Re: queryString and CGI.

2001-06-19 Thread Timothy Kimball
I wrote: : You should have to write this yourself. Sorry, that should have been: You should *not* have to write this for yourself. -- tdk

Re: queryString and CGI.

2001-06-19 Thread Timothy Kimball
Vontel Girish wrote: : CAN ANYONE TELL ME WHEN I AM WRITING A CGI PROGRAM : FOR CONNECTING TO MYSQL DATABASE AND DUMPING THE DATA : INTO THE TABLE, WILL I HAVE TO INCLUDE THE ABOVE PIECE : OF CODE FOR SPLITTING THE QUERYSTRING INTO NAME VALUE : PAIRS? You should have to write this yourself.

Re: testing for max size of file

2001-06-18 Thread Timothy Kimball
Curtis Poe wrote: : That will only give the approximate filesize. $ENV{CONTENT_LENGTH} is the total :size of the : entity body. With 'multipart/form-data' (the enctype used with file uploading), the :entity bodies : size is even larger than normal. The more data sent (besides the file), the

Re: MIME::Lite

2001-06-18 Thread Timothy Kimball
Teresa Raymond write: : OK, I'm not going to write my own script for attaching an email. I'm : going to try to modify the script from Randal's Web Techniques. I : need to point to the location of MIME::Lite. I'm having difficulty : with syntax with CGI.pm and strict. all of the below gives

Re: Crypt-SSLeay-0.22

2001-06-18 Thread Timothy Kimball
Jim J Wigginton wrote: : I'm trying to compile Crypt-SSLeay-0.22, and I get the following error, : midway through the process: : crypt_ssleay_version.h:1:17: ssl.h: No such file or directory. : crypt_ssleay_version.h:2:20: crypto.h: No such file or directory. Looks like either you don't have one

Re: testing for max size of file

2001-06-18 Thread Timothy Kimball
Teresa Raymond wrote: : How do I access the file size without making filesize a parameter : input by the user? This should be in the $ENV{CONTENT_LENGTH} variable. -- tdk

Re: testing for max size of file

2001-06-18 Thread Timothy Kimball
Teresa Raymond wrote: : This does not work, there is no error msg, it just doesn't get paid : attention to. : : if ($cgi->param('$filesize')>=$CGI::POST_MAX) : { print "Your file is too large to send"; : } Get rid of the $ in front of filesize. Should just be if ( $cgi->param('filesize')>=$

Re: Example of OOP cgi ?

2001-06-18 Thread Timothy Kimball
Brett W. McCoy wrote: : On Sat, 16 Jun 2001, Steve Howard wrote: : : > Can someone point me to an example of a completely Object Oriented CGI : > script. The Perldoc examples are procedural, but there must be a good OOP : > example somewhere for me to tear apart and learn that technique from. :

Re: Something wrong with my one line code

2001-06-15 Thread Timothy Kimball
Luinrandir Hernson wrote: : This line of code in a perl script comes up with errors. : ... : print "\n; Needs a closing quote after the \n. -- tdk

Re: HTML::Parser

2001-06-15 Thread Timothy Kimball
Jim J Wigginton wrote: : I'm trying to run a script which uses the HTML-Parser-3.25 scripts, and : every time, I get this error: : Can't locate loadable object for module HTML::Parser in @INC. : The file Parser.pm is in the @INC directory, and the lib directory within : the tar file is in the @IN

Re: regex question

2001-06-15 Thread Timothy Kimball
Robert Watterson wrote: : I have a line that has each field separated by commas. However, some of : individual fields are double quoted strings and also have embedded commas in : them. The Text::CSV_XS module will handle this. -- tdk

Re: So what am I doing incorrectly??

2001-06-14 Thread Timothy Kimball
Luinrandir Hernson wrote: : srand; : $A = int (rand (4)) : if ($A eq '0') {print "\n"}; : if ($A eq '1') {print "\n"}; : if ($A eq '2') {print "\n"}; : if ($A eq '3') {print "\n"}; Need a semicolon after the second line. When I add that, it works fine for me. -- tdk

RE: Telnet

2001-06-14 Thread Timothy Kimball
Sally wrote: : Are you assuming I'm running from unix? I'm not I run on windows I just tried it under Windows 2000 and it worked for me. -- tdk

Re: Telnet

2001-06-14 Thread Timothy Kimball
Derek Harding wrote: : ... I'm not : sure that telnet is defunct, though. Is it? No, it's not. "Defunct" means it no longer exists. Telnet is very definitely alive and well. Though it is insecure for general communications, since it talks directly to any port, it's very handy for debugging web

RE: using modules installed in local CGI bin

2001-06-08 Thread Timothy Kimball
Al Hospers wrote: : I changed the setup to : : #!/usr/local/bin/perl : use CGI qw(:all); : use lib "./libnet"; : use Net::FTP; : print header; : ... : now I get this error : : BEGIN failed--compilation aborted at weather_ftp.cgi line 4. I presume this is from the server's error_log. Is th

Re: using modules installed in local CGI bin

2001-06-08 Thread Timothy Kimball
: use line "./libnet"; sorry, that should be use lib "./libnet"; -- tdk

Re: using modules installed in local CGI bin

2001-06-08 Thread Timothy Kimball
Al Hospers wrote: : ... HOWEVER, I cannot get my : script to find the modules. : : here's the initial part of the code. according to the error message it fails : on line 4 where it cannot find the Net::FTP module. : : #!/usr/local/bin/perl : use CGI qw(:all); : use lib "/libnet/Net"; : use

Re: $ENV(HTTP_REFERER)?

2001-06-07 Thread Timothy Kimball
Dianne Van Dulken wrote: : I was hoping someone would be able to give me a clue how I could find the : referer IP. If I use the Environment HTTP_REFERER, it will work in IE, but : not in Netscape. : : Does anyone know of another method that allows me to read this? Should work with Netscape; it

Re: $ENV(HTTP_REFERER)?

2001-06-07 Thread Timothy Kimball
Luinrandir Hernson wrote:: open(A,">>/home/thx-1138/cgi-bin/data/refs.htm"); : print A "$ENV{'HTTP_REFERRER'}\n"; : close (A); : : The file opens, prints a return/linefeed and closes... : : any ideas why this wont work??? : it looks correct to me from what i have read. Two thoughts: * The env

Re: cgi-lib.pl

2001-06-06 Thread Timothy Kimball
Cheryl Kirkpatrick wrote: : I took an online course that did a pretty good job of teaching the : basics of Perl. At least, I hope that it did. However, the instructor : had us use "cgi-lib.pl" instead of teaching us how to store incoming : data from a form to an array. I have since read that us

Re: CGI-BIN

2001-06-05 Thread Timothy Kimball
Randal L. Schwartz: : I'm not sure why people are still so entranced by the use of the : word "ScriptAlias". Not to mention that ScriptAlias is something : only the webmaster can edit, not general users, since it's illegal : to use in an .htaccess file. : ... : So, for example, if you wanted ~me

Re: REPOST: Regex compilation in mod_perl?

2001-06-05 Thread Timothy Kimball
Len Walter wrote: : Since the data is "string\n\rstring" I figured I could use split /^/ to : separate out the individual strings. There's probably an easier way to do it : though... the split seems to work correctly, and both @strings and %content : get filled apparently ok. Try splitting on

Re: if statement printing when it shouldnt :)

2001-06-04 Thread Timothy Kimball
[EMAIL PROTECTED] wrote: : if ( $viewtag = "1" ) { : print "The value of \$view was $view\n"; : } : : i would have thought that the second statement would not print since the : form had not been "submitted". however, instead, the if statements' print : does get stuck into the html. A pernicio

Re: Netscape problem

2001-05-29 Thread Timothy Kimball
: From [EMAIL PROTECTED] Tue May 29 15:54 EDT 2001 : Mailing-List: contact [EMAIL PROTECTED]; run by ezmlm : List-Post: : List-Help: : List-Unsubscribe: : List-Subscribe: : Delivered-To: ma

Re: Silent Ending

2001-05-29 Thread Timothy Kimball
Rodney Myers wrote: : My script creates an email using sendmail. : The script is not called directly from the browser but from another server : as as the indirect result of a submit to that server. : : So there is no need to write anything to the browser, nor to redirect the : browser. But I see