Re: Checking Form data

2002-08-14 Thread perl-dvd
For July's javascript stat try http://www.thecounter.com/stats/2002/July/javas.php For any month statistics with javascript, java, os's, browsers, resolutions, colordepth's http://www.thecounter.com/stats/ (note, after clicking on the month, notice the yellow area on the right for choosing the

Re: real beginners stuff

2002-08-13 Thread perl-dvd
Jimmy, Sorry I had not read this post before I replied to the other. You need the permissions on a folder to be readable and executable in order for people to read what is in that folder period (not just execute scripts). So your folder needs to be permissions 755. Your script must be read

Re: new lines

2002-08-13 Thread perl-dvd
Jimmy, Do you know html? In html you use "" (without the quotes) to display a line break. Personally, because of some reasoning's people have presented to me, I wont tell you to not use - print $q->header("text/html"); - But I would HI

Re: Problem with the code

2002-08-12 Thread perl-dvd
$self->{_Email} =~ /(@.*@)|(\.\.)|(@\.)|(\.@)|(^\.)/ || $self->{_Email} !~ /^.+\@(\[?)[a-zA-Z0-9\-\.]+\.([a-zA-Z]{2,3}|[0-9]{1,3})(\]?)$/ should be $self->{_Email} =~ /(@.*@)|(\.\.)|(@\.)|(\.@)|(^\.)/ || $self->{_Email} !~ /^.+\@(\[?)[a-zA-Z0-9\-\.]+\.([a-zA-Z]{2,4}|[0-9]{1,3})(\]?)$/ Regards,

Re: Post to a second CGI script

2002-07-31 Thread perl-dvd
Jim, My recommendation is to write a session file on your server and pass the session id around with the browser variables. Now whether you use cookies, get or post to pass the session id, you don't have to be passing the actual username. If you don't want to have the user see the session

Re: malformed header from script???

2002-07-25 Thread perl-dvd
Webster, Looks like your content-type is not being printed soon enough. You should consider placing it at the very top of your script unless you expect print some other kind of header (like a Location). print "Content-Type: text/html\n\n"; Regards, David - Original Message - From

Re: HTTP_REFERER

2002-07-24 Thread perl-dvd
Well, there you have it Shao-Ju. Hey, I learned something new today. Cool. - Original Message - From: "Bob Showalter" <[EMAIL PROTECTED]> To: "'Shao-Ju Chao'" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]> Sent: Wednesday, July 24, 2002 7:56 AM Subject: RE: HTTP_REFERER > -Original

Re: HTTP_REFERER

2002-07-24 Thread perl-dvd
Shao-Ju, Yes, but it does not exist when there was no referer. So, for example, if somebody just went strait to test.pl, it would not have a referer, but if somebody went to test.html which had a link to test.pl, then you would have a referer which would be the url of test.html Regards, Da

Re: Web tools

2002-07-23 Thread perl-dvd
Samuel, Well, you could hop on cpan.org and find yourself a module that will do the ping for you, or you could use a less proper method like the following: - # pretend you got $ipaddress through CGI.pm or something like that print "Content-Type: text/h

Re: regex - problem

2002-07-22 Thread perl-dvd
Alex, Did you get the problem fixed? Yes it was because you did not escape your . when you wanted a . instead of an any character. ..[a-zA-Z]{2,3} will match ".abc", but it will also match "abcd" but \.[a-zA-Z]{2,3} will require that the first character this part of the regular expression

Re: Buffer output?

2002-07-22 Thread perl-dvd
Teddy, $|=1; is supposed to perl to print to standard out right away instead of buffer information. You see, by default Perl buffers what it is going to print out until the buffer is full, then prints. For some reason, when I use $|=1; It seems that the first output to STDOUT is buffere

Re: formate text sequence

2002-07-17 Thread perl-dvd
Konrad, Is this what your looking for? -- my $input = 'ABCDEFGHI'; my $output = $input; $output =~ s/(\w{3})/\$1\<\/p\>/g; print qq^\$input = "$input"\n^; print qq^\$output = "$output"\n^; -- To mak

Re: Couple of newbie questions

2002-07-16 Thread perl-dvd
Kerr, Apache spawns a child for each web connection, while doing this, if a cgi script is called, it pulls a copy of the script into memory, executes it. Ways to debug: Yes Apache does have an error log, search your httpd.conf for "ErrorLog". That like specifies where Apache will write

Re: Why "Premature end of script headers"?

2002-07-15 Thread perl-dvd
Yes, your right. It seems to me there has got to be a more efficient way to accomplish what is being attempted. Right now, the solution is making a copy of the file, then checking every line of the original against every line of the copy. This method becomes exponentially more processor

Re: Why "Premature end of script headers"?

2002-07-15 Thread perl-dvd
> Probably your web server is timing out the request and killing your > script. Web servers don't like to run long-running processes like > this. Perhaps you can fork off a child and have the child take care > of it. Another solution is to have something like the following in your loop: -

Re: Counting the time with fractions of a second. The solution!

2002-07-15 Thread perl-dvd
Teddy, Because times is a perl function, not necessarily a var. Here's what one of my perl books has to say about it: --- The times function returns the amount of job time consumed by this program and any child processes of this program.

Re: Executing cgi from perl script

2002-07-12 Thread perl-dvd
Shane, Um, first of all, you probably shouldn't be modifying your cgi script dynamically, Lots of room for error. What you should be doing instead is perhaps updating a text file that the cgi script will open and use as its "Insert content here" content. Next, how is the template.cgi be

Re: What is this string type? How to play with?

2002-07-11 Thread perl-dvd
Sorry, one more oops $form_vars{$name} = [($form_vars{$name})] if (ref($form_vars{$name} ne "ARRAY")); should be $form_vars{$name} = [($form_vars{$name})] if (ref($form_vars{$name}) ne "ARRAY"); Sorry about these, there were a few recommendations I've received, and I had not implemented them

Re: What is this string type? How to play with?

2002-07-11 Thread perl-dvd
Oops, let me make one small revision to my code: if (exists($form_vars{$name})) { # if this is the first of this form input name. should be if (!exists($form_vars{$name})) { # if this is the first of this form input name. Sorry about that all. Regards, David - Original Message - Fro

Re: What is this string type? How to play with?

2002-07-11 Thread perl-dvd
Connie, > ; has no problem, why you would like to escape( \ )it ? I know that = and ; don't have a problem, I escape them because I escape every special character, that way I don't have to worry about what I do and don't need to escape. I know, bad habit (old habits die hard). > Besides, if y

Re: What is this string type? How to play with?

2002-07-11 Thread perl-dvd
Connie, Something like the following is probably what you are looking for. Of course what you should be doing is using CGI.pm or some other tested form of input retrieval. my @variables = split(/[\&\;]/, $input); fo

Re: Username & Password Question

2002-07-08 Thread perl-dvd
When you have everything working, and something for security (htaccess), try redirecting by, NOT printing a content-type (text/html or whatever), then print this: print "Location: http://www.domain.com/path/morepath/file.html\n\n";; The capitalization and space are very important. Regard

Re: Form.pm (next installment of code review)

2002-07-08 Thread perl-dvd
Curtis, Thank you for your observations and compliments (first paragraph). No your right, I haven't been using taint (*I hang my head in shame*). I probably would have done a few things slightly differently if I had a perfect vision I was I was creating when I began it. You see on the

Re: Form.pm

2002-07-03 Thread perl-dvd
Duh, I should have thought of that one. So the only time this would be an issue is if somebody not knowing that ; can be a element delimiter creates an href with a ; in the name or value. Ok, that solution works for me. Thanks, David - Original Message - From: "Ovid" <[EMAIL PROTECTE

Re: Including External Pages

2002-07-03 Thread perl-dvd
Of course, and usually that's the way I do it. Basically, if you put the local statement in a block, then the scope of the change to the system variable is only effective inside of the block. Just like if you did this: -- { my $cool = "stuff"; print q

Re: Form.pm

2002-07-03 Thread perl-dvd
I did not say that you said this. I did say that was the tone (or feeling created based on what was said). I knew you had mentioned the ; vs & thing before. But at that time, I still did not have a solutions to replace it with. I understand the frustration of telling somebody somethin

Re: Form.pm

2002-07-03 Thread perl-dvd
<[EMAIL PROTECTED]> Sent: Wednesday, July 03, 2002 11:46 AM Subject: Re: Form.pm perl-dvd wrote at Wed, 03 Jul 2002 19:22:49 +0200: > > Yes, my lines of code are long. For this I apologize. I work on 1600x1200 with >Homesite > which > doesn't

Re: Form.pm

2002-07-03 Thread perl-dvd
Niko, As I said in the bottom of that email, that is one of the optional features I will provide in the future, to allow acceptance of get along with post. David - Original Message - From: "Niko Gunadi" <[EMAIL PROTECTED]> To: "Beginners cgi" <[EMAIL PROTECTED]> Sent: Wednesday, Ju

Re: Form.pm

2002-07-03 Thread perl-dvd
Curtis, Of course I'm not going to take this personally, this is the very reason I submitted the code. I appreciate your feedback. The reason I was frustrated with Todd is because it was strictly criticism. Basically the tone was "Your wrong, and you shouldn't be making your own lib anywa

Re: Including External Pages

2002-07-03 Thread perl-dvd
The reason I explained how to slurp the file into a variable was so that it could be printed anytime anywhere. My solution does not force the file contents to be printed right away. This is also useful for if you wish to replace something in the faq before printing it, or adding some to the t

Re: Form.pm

2002-07-03 Thread perl-dvd
Curtis, Thank you for the compliment. Please do inform me of what should be modified. Thanks, David - Original Message - From: "Ovid" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]> Sent: Tuesday, July 02, 2002 6:18 PM Subject: Re: Form.pm --- Todd Wade <[EMAIL

Re: Form.pm

2002-07-03 Thread perl-dvd
Todd, Oh you mean like this: my(@pairs) = split('&',$tosplit); my($param,$value); foreach (@pairs) { ($param,$value) = split('=',$_,2); $param = unescape($param); $value = unescape($value); $self->add_parameter($param

Re: Help! which are the correct parameters?

2002-07-03 Thread perl-dvd
Teddy, Well, this works, I've tested it, --- my $test = qq^ Index About ^; $test =~ s/href\=\"(.*?)\"/href\=\"another_text_$1\"/g; print $test; - The reason the other even with an /s did not work was because

Re: winlinux

2002-07-02 Thread perl-dvd
You of course have to pay for the full registration, but you can download the demo and try it out from here: http://labf.com/download/winaxe.html Regards. David - Original Message - From: <[EMAIL PROTECTED]> To: "Martin Pestun" <[EMAIL PROTECTED]> Cc: <[EMAIL PROTECTED]> Sent: Tuesday

Form.pm

2002-07-01 Thread perl-dvd
    Well, I'm a little bit behind schedule because the home page for Form.pm just got erased (long story).  Anyway, I just setup a backup system on my server now so I'll have a weeks worth of daily backup's (ya, I know I should have had this before).  But attached are the main functions of F

Re: CGI.pm v/s roll-your-own [WAS:] Displaying Problems

2002-07-01 Thread perl-dvd
Curtis, Thanks for the reminder, I'll get it up shortly after I get home from work. About 5:00pm Mountain Time. David - Original Message - From: "Ovid" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]> Sent: Monday, July 01, 2002 11:39 AM Subject: Re: CGI.pm v/s roll

Re: Including External Pages

2002-07-01 Thread perl-dvd
open(FH, " for write, >> for append local $/ = undef; # slurp mode (allow for shoving the whole file into a scalar) my $faq = ; # slurp the whole file into this scalar. close(FH); - Original Message - From: "Kyle Babich" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Sunday, June 3

Re: Help! which are the correct parameters?

2002-07-01 Thread perl-dvd
my $stuff = qq^ here is some stuff and more stuff to boot stuff for me and stuff for you ^; $stuff =~ s/stuff/money/gs; # g says match all occurrences # s says treat $stuff as a single line Regards, David - Original Message - From: "Octavian Rasnita" <[EMAIL PROTECTED]> To: <[EMAIL P

Re: Printing the Content-type

2002-07-01 Thread perl-dvd
Look up the wget package for Linux. or you can try the combination of these: HTTP::Request; LWP::UserAgent; Regards, David - Original Message - From: "Octavian Rasnita" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Friday, June 28, 2002 6:25 AM Subject: Printing the Content-typ

Re: Verifying the existence of a file

2002-07-01 Thread perl-dvd
Teddy, Try: if (-e "/usr/www/domain/file.txt"){ print "file.txt exists\n"; } A few others are -f to check if it is an ordinary file, -d to find if it exists and is a directory, -l to find if it exists and is a symlink, -T to find if it exists and is a plain text file. There are about 2

Re: CGI.pm v/s roll-your-own [WAS:] Displaying Problems

2002-06-27 Thread perl-dvd
No offence taken, I have heard the word hubris before, but I wasn't certain of the meaning, so naturally I looked it up (now that you mention it, I have heard that quote out of the Camel book before). At first I thought it was a compliment the way you said it and all, but after seeing dictiona

Re: CGI.pm v/s roll-your-own [WAS:] Displaying Problems

2002-06-27 Thread perl-dvd
That actually has nothing to do with it. It has everything to do with the strong desire to improve circumstances, be innovative, make the world a better place. If you want to call me arrogant for trying to improve my surroundings, go right ahead, but your tacking the wrong name on me. David

Re: CGI.pm v/s roll-your-own [WAS:] Displaying Problems

2002-06-27 Thread perl-dvd
by the way, :) is a smiley, it means I'm joking with you. (reference the last email) With mine, there is nothing beyond what I described. The hash structure I gave you below, that's it. Form.pm takes the input, makes a hash with it, and if you understand how to use a hash and array ref, your

Re: CGI.pm v/s roll-your-own [WAS:] Displaying Problems

2002-06-27 Thread perl-dvd
my point stands :) So out of curiosity, what kind of data structure do you get back with this? If its as I would imagine, then its very close to my own. %hash = ( 'a_name' => 'value', # for single name value pairs 'b_name' => ["multiple", "values", "for", "this"], # for single name

Re: Displaying Problems

2002-06-27 Thread perl-dvd
You make a very good point fliptop, I did forget the nature of this mailing list. As far as CGI.pm debating, I will step down in this mailing list. David - Original Message - From: "fliptop" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Cc: "Bob Showalter" <[EMAIL PROTECTED]>; <[EMAIL

Re: CGI.pm v/s roll-your-own [WAS:] Displaying Problems

2002-06-27 Thread perl-dvd
The difference is, the efficiency and data structure CGI.pm returns. Mine came to I think 72 times faster when not uploading images, and 2.5 times faster when uploading images. I'm not saying CGI.pm is written poorly or anything, I am saying that it is a little bit bloated and has a lot o

Re: Extract numbers from in between parentheses with regex

2002-06-26 Thread perl-dvd
-- my $var = "(801) 555-"; # ya, ok so I'm in utah :) $var =~ /(\(\d+\))/; # real paren, escape paren, \d = digits, # + = one or more, escape paren, real paren my $area_code = $1; # set to what came from between the real parens

Re: Displaying Problems

2002-06-25 Thread perl-dvd
Bob, That's interesting. You know, I work with about 5 other perl programmers, most of which do use CGI.pm, but none of them use it for anything other that gathering input from the web. I have also downloaded many packages from CPAN, I would say a majority of them use CGI.pm, but very r

Re: Displaying Problems

2002-06-25 Thread perl-dvd
Ok, so here's the deal: "Some HTTP/1.0 software has interpreted a Content-Type header without charset parameter incorrectly to mean "recipient should guess." Senders wishing to defeat this behavior MAY include a charset parameter even when the charset is ISO-8859-1 and SHOULD do so when it is k

Re: Displaying Problems

2002-06-25 Thread perl-dvd
Bob, > CGI.pm--a threat to our way of life! Down with the troglodytes! :) Well, not exactly my point, but ok :) Just kidding I just think there are too many who close their minds to anything but CGI.pm, including potentially more efficient customized solutions. David - Original Message

Re: Displaying Problems

2002-06-25 Thread perl-dvd
Bob, > I fail to see how writing code with errors is somehow CGI.pm's fault No its not. But I'll tell you one thing, people who depend so heavily on CGI.pm generally have a good understanding of how to use CGI.pm, but have less understanding of what is really going on. Me personally, I want t

Re: Displaying Problems

2002-06-25 Thread perl-dvd
Kyle, Well, I'd start by printing an actual content type instead of depending on CGI.pm for that: --- print "content-type: text/html\n\n"; --- Second, I would condense your if to this -

Re: What editor for Perl do you recommend?

2002-06-24 Thread perl-dvd
By all means, Homesite. Ok, so it actually cost a few dollars, but this thing does great things for you. - It color codes html, perl, sql, css and so on. - save your files as windows, unix or mac format. - upon opening files, auto discover which format and display correctly - open multiple fil

Re: text problem

2002-06-24 Thread perl-dvd
Martin, Well, you can use a simple html tag called pre. --- open(FILE, "; close(FILE); print qq^ $contents_of_file ^; --- Is that what you are looking for or do you want to actually split up the data into i

Re: return =1

2002-06-24 Thread perl-dvd
Octavian, Secondly, by your explanation, I'm not sure whether you know this, but your if should be like this: -- my $test = sub_name(); if ($test){ # stuff } -- Or -- if (sub_name()){ # stuff } ---

Re: Question about redirect

2002-06-24 Thread perl-dvd
Erik, Try not printing print "Content-type: text/html\n\n"; then print print "Location: /path/prog1.cgi\n\n"; regards, David - Original Message - From: "Erik Riggenbach" <[EMAIL PROTECTED]> To: "Beginners-Cgi" <[EMAIL PROTECTED]> Sent: Saturday, June 22, 2002 6:59 PM Subject:

Re: GET/POST handleing

2002-06-24 Thread perl-dvd
Curtis, Is this why you want my CGI.pm input replacement lib? So you can turn around and tell me why CGI.pm is so much superior? As I read through the tutorial here, with every thing said, the basic message seemed to be "It doesn't matter who you are or how smart you think you are, your n

Re: calling sub based on database list?

2002-06-24 Thread perl-dvd
No, this is quite a simple problem actually. Here's how. my $alias = "home|htmlBody,Header,homebody,footer"; my ($name, $subs) = split(/\|/, $alias); my @subs = split(/\,/, $subs); foreach $sub(@subs){ my $return_val = &{$sub}($pass_in_vars); } So the first part I assume you've got whe

Re: CGI.pm

2002-06-21 Thread perl-dvd
The template replacement I cant give because I wasn't the one who wrote it, but Form.pm is my CGI.pm replacement for receiving data. I wrote it approximately 2 1/2 years ago and have been tweaking and improving it since. I'll release it to C-PAN within the next month I think, look for i

Re: PERL!! : )

2002-06-21 Thread perl-dvd
You know, I'm a not a Microsoft fan by any means (if you ask people who know me, you would probably get more rash descriptions of how I feel about them). When it comes to using an os as a client, Windows 2000 is pretty nice. But when it comes to running a server, I will avoid windows at a