RE: Use Strict

2005-01-13 Thread Ovid
ckage): $main::one_constant However, I would urge you to turn "bunch_of_constants.pl" into a proper module and using Exporter. References: perldoc -f my perldoc -f package perldoc perlmod perldoc Exporter Cheers, Ovid = Silence is Evil http://users.easystree

Re: Read Write to file .. need help

2005-01-14 Thread Ovid
clean way of handling this by using what are known as "semaphore" files, read "Resource locking with semaphore files" (http://interglacial.com/~sburke/tpj/as_html/tpj23.html) Cheers, Ovid = Silence is Evil http://users.easystreet.com/ovid/philosophy/decen

Re: print $q->p(with CSS)

2005-01-16 Thread Ovid
out the one these as well: > > > but it has to be in the of the starting HTML? -- and I would > like it > before the and after the print $q->start_html( -head => $q->Link({-rel=>"stylesheet", -href=>"main.css"}), -title => "

Re: perl-CGI module - post method

2005-02-08 Thread Ovid
OST.\n"; print "Content length was $ENV{CONTENT_LENGTH}\n"; my $buffer; if (read (STDIN, $buffer, $ENV{'CONTENT_LENGTH'})) { print $buffer; } else { print "Could not read STDIN"; } } else { print "Don't know how to

Re: perl-CGI module - post method

2005-02-08 Thread Ovid
; is not fun and it's easy to get wrong. If someone needs multiple values, they should just take advantage of list context: my $foo = $cgi->param('foo'); # single value # versus my @foo = $cgi->param('foo'); # multiple values Cheers, Ovid = If this

Re: perl-CGI module - post method

2005-02-08 Thread Ovid
per element, though, most people would choose something like this: my %form = map { $_ => $cgi->param($_) } $cgi->param; Of course, that loses data if any params have multiple values, but again, most forms are not like that. There are other ways to deal with this, but they are pretty s

Re: Favorite Perl CGI Framework for Web Site Development?

2005-02-11 Thread Ovid
s a good choice, though I've heard good things about it. There's also OpenInteract (http://www.openinteract.org/). I know nothing about it, but it's been around for a while so presumably (?) it's stable and well-tested. Cheers, Ovid = If this message is a response to a qu

Re: Generating a hierarchy path

2005-02-11 Thread Ovid
e code vulnerable to an SQL injection attack (http://www.unixwiz.net/techtips/sql-injection.html). I've converted the code to use bind values to prevent this security problem. See "perldoc DBI" and read the section entitled "Placeholders and Bind Values". Cheers, Ovid sub pathme

Re: Challenge (for me, at least)

2005-02-18 Thread Ovid
how about squeezing this into one line: > > $device = $q->param( "device_name" ); > $device = $ARGV[0] if ! $device; > chomp ( $device = ) if ! $device; That would be tougher, but I wouldn't squeeze all of that onto one line because after a bit, rea

Re: Calling subroutines

2005-03-21 Thread Ovid
'); if (my $action = $dispatch{$action}) { $action->(@some_args); } else { # die or go to a default page } Solutions like this is generally easy to understand (particular when using named actions). Cheers, Ovid -- If this message is a response to a question on a mailing

Re: Errors while inserting into long data type

2005-04-11 Thread Ovid
Oh, and I see you *did* send this to the DBI list. Never mind my previous comment :) Cheers, Ovid --- Mallik <[EMAIL PROTECTED]> wrote: > Hi Friends, -- If this message is a response to a question on a mailing list, please send follow up questions to the list. Web Programming

Re: Errors while inserting into long data type

2005-04-11 Thread Ovid
27;$some_var'); Not only is that a potential security hole if done incorrectly, but I believe some DBD's will choke if $some_var is too large. Try using a bind variable and see if that avoids the problem: my $sth = $dbh->prepare("INSERT INTO TABLE (name) VALUES (?)"); $st

Re: Variables in Modules

2005-04-13 Thread Ovid
of protection to ensure that naughty code isn't doing things it should not be doing and, if it ever gets set to a bad value, you have only one place to put your debugging code. Cheers, Ovid -- If this message is a response to a question on a mailing list, please send follow up questions

Re: Hash array

2005-05-12 Thread Ovid
the > $hash->{$key} if is > not known so each element can be displayed. Arrays in scalar context return the number of elements in the array. Try this: my $num_elements = @{ $hash->{$key }; Cheers, Ovid -- If this message is a response to a question on a mailing list, plea

Re: Hash array

2005-05-13 Thread Ovid
* code snippet :) my $num_elements = @{ $hash->{$key} }; # missing a curly Cheers, Ovid -- If this message is a response to a question on a mailing list, please send follow up questions to the list. Web Programming with Perl -- http://users.easystreet.com/ovid/cgi_course/ -- To unsubscribe

Re: Just to know why ?: is not working here

2005-06-13 Thread Ovid
42 That can be fixed by moving the right parenthesis to encompass the expression you wish to evaluate: perl -le 'print (42 ? "foo" : "bar")' foo Cheers, Ovid -- If this message is a response to a question on a mailing list, please send follow up questions t

Re: HTML::Templates

2005-06-28 Thread Ovid
stion is to ask how you are maintaining state. Can you cache the users state in a local session and give them a cookie with the session key? Cheers, Ovid -- If this message is a response to a question on a mailing list, please send follow up questions to the list. Web Programming with Perl

RE: How to grep out contnts of a column

2005-07-11 Thread Ovid
I guess I am missing a Filter module, but there are numerous on the > CPAN. Which module should I download next? Filter::Util::Call is in Filter: http://search.cpan.org/dist/Filter/ Cheers, Ovid -- If this message is a response to a question on a mailing list, please send follow up questions

Re: htaccess question

2005-08-11 Thread Ovid
format. I don't know if that's true. In any event, when using .htaccess, I would strongly recommend using it over a secure connection. Cheers, Ovid -- If this message is a response to a question on a mailing list, please send follow up questions to the list. Web Programming with Perl

Re: getstore and comments

2005-08-19 Thread Ovid
ct into package main is not what was intended. You may wish to read my CGI Course at http://users.easystreet.com/ovid/cgi_course/ I cover similar issues and I also discuss the values of taint checking. Hope this helps! Cheers, Ovid -- If this message is a response to a question on a mailing list

Re: upload question

2005-08-25 Thread Ovid
ilename. >From "perldoc -f read": read FILEHANDLE,SCALAR,LENGTH,OFFSET read FILEHANDLE,SCALAR,LENGTH Attempts to read LENGTH characters of data into variable SCALAR from the specified FILEHANDLE. Cheers, Ovid -- If this message is a response to a question on a mailing list

Re: count how many tags

2005-08-31 Thread Ovid
last; } } } foreach my $type ( keys %tag_for ) { printf "%10s %3d\n", $type, $tag_for{$type}{count}; } print "\n"; foreach my $type ( keys %attribute_for ) { printf "%10s %3d\n", $type, $attribute_for{$type}

Re: count how many tags

2005-08-31 Thread Ovid
--- Ovid <[EMAIL PROTECTED]> wrote: > First, I would suggest that you're trying to count two different > things, tags and attributes. You may wish to separate them. The > following code will do what you want. It uses the > HTML::TokeParser::Simple module to make

Re: Exact matching using GREP.

2005-09-08 Thread Ovid
ACT matching using GREP? because the above > code prints every element from array for 'php' if the > $row->{CAT_TITLE} is 'php' it prints php/counters, php/forums and > every element containing php. Assuming I understood your question correctly: if (grep { $_ eq

Re: CGI.PM and IF statment....

2005-09-10 Thread Ovid
uot;0" is 1, but you really don't care about that. I would leave the value as 0 or set it to the empty string and write the condition like this: if ($mt) { ... } Cheers, Ovid -- If this message is a response to a question on a mailing list, please send follow up questions to the

RE: Use of uninitialized value

2005-09-14 Thread Ovid
return 'bar'; } print bar(); } print bar(); If you really need lexically scoped subroutines, assign an anonymous subroutine to a scalar: sub foo { my $bar = sub { return 'bar'; }; print $bar->(); } # no access to $bar from here Cheers, Ovid --

Re: Yet another package problem

2005-09-16 Thread Ovid
more general advice about making your programs more robust, please don't hesitate to ask. Cheers, Ovid -- If this message is a response to a question on a mailing list, please send follow up questions to the list. Web Programming with Perl -- http://users.easystreet.com/ovid/cgi_course/

Re: How big is too big?

2005-09-17 Thread Ovid
ause developing higher quality code and constantly refactoring means that my code base is much easier to work with. I'm rarely "hacking around problems". Cheers, Ovid -- If this message is a response to a question on a mailing list, please send follow up questions to the list. Web

Re: How big is too big?

2005-09-17 Thread Ovid
--- Tony Frasketi <[EMAIL PROTECTED]> wrote: > Thank a lot Ovid Your explanation enlightened me to the existance > of the variousTest modules... You're quite welcome. > Test::Unit <http://search.cpan.org/perldoc/Test::Unit> is an > interesting XUnit-style tes

Re: New Website for Perl Beginners: perlmeme.org

2005-10-02 Thread Ovid
g seems petty but for a site which has the stated goal of addressing the "many irrational anti-Perl memes", it really needs to get things right. Cheers, Ovid -- If this message is a response to a question on a mailing list, please send follow up questions to the list. Web Programming w

Re: $CGI::DISABLE_UPLOADS

2005-10-19 Thread Ovid
nly read part of their upload). In order to get around this, you'll want to look into mod_perl or some other technology which allows Perl to have access to the full server request cycle. Cheers, Ovid -- If this message is a response to a question on a mailing list, please send follow up ques

Re: CGI parameters

2005-10-24 Thread Ovid
old cgi-lib scripts. Becuase it separates values with null bytes, you run the risk of exposing you code to a security hole known as the "null byte hack". I explain the latter in lesson three of my CGI course: http://users.easystreet.com/ovid/cgi_course/lessons/lesson_three.html Cheers

Re: CGI parameters

2005-10-25 Thread Ovid
; print $cgi->header('text/plain'); foreach my $name ( @params ) { # assumes single value params print "$name: " . $cgi->param($name) . "\n"; } Versus: use CGI qw(:standard); print header('text/plain'); foreach my $name ( param() )

Re: Taking Multiple Values for The Same Form Field.

2005-10-28 Thread Ovid
--- Sara <[EMAIL PROTECTED]> wrote: > > use CGI; > my $q = new CGI; > > my $name = $q->param('name'); > > Now What as multiple name values will be coming.?? Use list context: my @names = $q->param('name'); Cheers, Ovid

Re: Taking Multiple Values for The Same Form Field.

2005-10-28 Thread Ovid
n an empty string for that. This should let you keep your @name and @email arrays in synch. Even if you are using a POST, there should be a query string in the entity-body and CGI.pm *should* handle this correctly. Cheers, Ovid -- If this message is a response to a question on a mailing list, pl

Re: incorporer du php dans une page en perl-cgi ?

2005-12-03 Thread Ovid
;getVariable('$main::var[0]'); return $value; } /; print $p->bar(); # should print "hello" Cheers, Ovid -- If this message is a response to a question on a mailing list, please send follow up questions to the list. Web Programming with Perl -- http://users

Re: checking existance of an item in an array

2006-02-06 Thread Ovid
destination{$url} ) { $destination_url = "/$url"; } } Since you're new to Perl, the map statement will look weird. You might find it clearer to do this (and this will create the same data structure as the map statement): my %safe_destination = ( '

Re: Pointers on security sought for CGI

2006-03-15 Thread Ovid
n up the mess. Hi Mary, Glad you're thinking about security early. Too many folks don't. I have a brief introduction to CGI security at http://users.easystreet.com/ovid/cgi_course/lessons/lesson_three.html. It's not complete, but it covers the basics (there are a lot of things

Re: How to do a static variable that persists from page to page

2006-04-28 Thread Ovid
{ # data has been tampered with } Note that a random secret key can be problematic. Using different secret keys for creating the digest and testing the digest guarantees that the digests will not match. Cheers, Ovid -- If this message is a response to a question on a mail

Re: Need help parsing QUERY_STRING_UNESCAPED

2006-05-23 Thread Ovid
STRING_UNESCAPED = This led me to some searching on Perlmonks where some solutions were discussed in http://www.perlmonks.org/?node_id=54318. Hopefully that will give you further clues. Cheers, Ovid -- If this message is a response to a question on a mailing list, please send follow up questio

Re: Multiple .cgi scripts vs. one large script

2006-06-15 Thread Ovid
#x27;t going to help that much. The "don't worry about performance at first" concept is one that many programmers balk at, but once you adopt it, it makes life much, much easier. Cheers, Ovid -- If this message is a response to a question on a mailing list, please send fol

Re: need help

2006-08-25 Thread Ovid
you check out the CPAN. It has many stock solutions for common situations like this. In this case, searching for PayPal reveals Business::PayPal::API http://search.cpan.org/dist/Business-PayPal-API/ Cheers, Ovid -- Buy the book -- http://www.oreilly.com/catalog/perlhks/ Pe

Re: Including a file with common variables...

2006-10-08 Thread Ovid
any of the modules *they've* required. I found it in a module which one of the *last* one's required. Of course, I first tried grepping through the code, only to find that the function name in question was reused in a number of places, so that didn't help, either. It was very

Re: Opening Filehandles under taint check

2002-05-22 Thread Ovid
efix[0] is tainted and the open is unsafe, so it kills your script. Untaint $mailPrefix[0] and your problem should be solved. Cheers, Curtis "Ovid" Poe = "Ovid" on http://www.perlmonks.org/ Someone asked me how to count to 10 in Perl: push@A,$_ for reverse q.e...q.n.;for(@A){$_

RE: Opening Filehandles under taint check

2002-05-23 Thread Ovid
--- Camilo Gonzalez <[EMAIL PROTECTED]> wrote: > Ovid, > > You're a god (or at least an erotic poet from Ancient Rome). That worked > perfectly. I feel like such an idiot. Thanks for pointing out the obvious. Camilo, Heh :) At least *some* people appreciate the name &

Re: Verifying the CONTENT_LENGTH

2002-05-29 Thread Ovid
ot;? If there is a problem with CGI.pm and Windows 2000, I am sure that *many* people would want to know. Cheers, Curtis "Ovid" Poe = "Ovid" on http://www.perlmonks.org/ Someone asked me how to count to 10 in Perl: push@A,$_ for reverse q.e...q.n.;for(@A){$_=unpack(q|c|,$_)

Re: why do I get the following warning for taint

2002-05-29 Thread Ovid
if you are just compiling for a test, supply the -T switch on the command line: perl -cT myscript.cgi Cheers, Curtis "Ovid" Poe = "Ovid" on http://www.perlmonks.org/ Someone asked me how to count to 10 in Perl: push@A,$_ for reverse q.e...q.n.;for(@A){$_=unpack(

Re: URL for security issue?

2002-05-30 Thread Ovid
t now. > Could whoever posted it please do so again, or maybe > just email it to me privately? Thanks! > > - John I'm not sure as to the link, but you can check out my course at http://www.easystreet.com/~ovid/cgi_course/ I focus heavily on security issues and include many links

First and second rate programmers

2002-06-05 Thread Ovid
plies very strongly to programmers, too): First-rate mathematicians want to hang around first-rate mathematicians. Second-rate mathematicians want to hang around third-rate mathematicians. The reason for that is left as an exercise for the reader :) Cheers, Curtis "Ovid"

Re: First and second rate programmers

2002-06-05 Thread Ovid
this (I have my reservations), but this is so prevalent that it was decided to retain this feature. Cheers, Curtis "Ovid" Poe = "Ovid" on http://www.perlmonks.org/ Someone asked me how to count to 10 in Perl: push@A,$_ for reverse q.e...q.n.;for(@A){$_=unpack(q|c|

Re: webBotting a Job Hunt

2002-06-07 Thread Ovid
n click my > way through all of them??? I think this is a great idea. Just be sure to be a good netizen and follow the Terms of Service that each site provides. Many sites (though I am not sure about the job sites) request that you do not use automated tools to access them (tools such as L

Re: file uploading

2002-06-13 Thread Ovid
->{'Content-Type'}; to get the content type, if you wish to restrict them. This, of course, is a convenience feature and not really a security feature as this is easily spoofed. Cheers, Curtis "Ovid" Poe = "Ovid" on http://www.perlmonks.org/ Someone asked

Re: Uploading Help

2002-06-14 Thread Ovid
t;param( "file$_" ) { my $filename = basename( $file ); open FILE, "> $user->{'site_id'}/$filename" or error(...); binmode $file; print FILE <$file>; $file_count++; } clo

Re: Uploading Help

2002-06-14 Thread Ovid
e FILE or die $!; } If you don't, you'll die the first time you try to close a file that you failed to open since I messed up the scope. Sorry 'bout that! Cheers, Curtis "Ovid" Poe = "Ovid" on http://www.perlmonks.org/ Someone asked me how

Re: CGI.pm

2002-06-21 Thread Ovid
I'll release it to C-PAN within the next month I think, look for it there. It >will be > called > Form.pm written by David Hicken. > > David David, That sounds good. It would be nice to see robust, well-written alternatives to CGI.pm. Any chance you can submit

Re: Can someone tell me what I did wrong with this?

2002-06-22 Thread Ovid
alar context # see perldoc -f localtime my $body = param('body'); my $content = '"body" didn't match'; if ($body eq "yahoo") { $content = qq{http://www.yahoo.com/";>Yahoo\n}; } elsif ($body eq "date") { $con

Re: GET/POST handleing

2002-06-22 Thread Ovid
mInfo = $ENV{QUERY_STRING}; > } elsif ($meth eq "POST") { > read(STDIN, $formInfo, $ENV{CONTENT_LENGTH}); > } [snip] Chris, By the time you finish reading http://www.easystreet.com/~ovid/cgi_course/lesson_two/lesson_two.html, you will be able to identify numerous bugs i

Re: Can someone tell me what I did wrong with this?

2002-06-22 Thread Ovid
k odd). Using /:standard/ is nice because it saves on typing :) > What is the content variable doing? I just put that in so that I could assign data to it and print it in the middle of the HTML document. Otherwise, you'd have to repeat the HTML for each 'if' conditional. > Ot

Re: Can someone tell me what I did wrong with this?

2002-06-22 Thread Ovid
k odd). Using /:standard/ is nice because it saves on typing :) > What is the content variable doing? I just put that in so that I could assign data to it and print it in the middle of the HTML document. Otherwise, you'd have to repeat the HTML for each 'if' conditional. > Ot

Re: Can someone tell me what I did wrong with this?

2002-06-23 Thread Ovid
redundant, but I've got a lot of email to answer, so I want to make this brief :) Cheers, Curtis "Ovid" Poe = "Ovid" on http://www.perlmonks.org/ Someone asked me how to count to 10 in Perl: push@A,$_ for reverse q.e...q.n.;for(@A

Re: Can someone tell me what I did wrong with this?

2002-06-23 Thread Ovid
Incidentally, you might have multiple values for the same name (such as being able to select several checkboxes: Basketball Soccer Baseball To pull in every value that was selected, use an array: my @sports = param('sport'); If you were to use a scalar (my $sport = ...), the

Re: test.cgi hashing error

2002-06-23 Thread Ovid
= each %pages ) { print qq{$key}\n}; } Cheers, Curtis "Ovid" Poe = "Ovid" on http://www.perlmonks.org/ Someone asked me how to count to 10 in Perl: push@A,$_ for reverse q.e...q.n.;for(@A){$_=unpack(q|c|,$_);@a=split//; shift@a;shift@a if $a[$[]eq$[;$_=join q||,@a};

Re: security check

2002-06-23 Thread Ovid
t to rely on HTTP_REFERER for security as it is very easy to fake. If you really need security, you will need to have some sort of authorization to accomplish this (such as a username/password combination). Cheers, Curtis "Ovid" Poe = "Ovid" on http://www.perlmonks.o

Re: passing variables in POST

2002-06-24 Thread Ovid
data leave the server, only a key to the data is sent). If it's really not that important, hidden HTML fields can be used. Cheers, Curtis "Ovid" Poe = "Ovid" on http://www.perlmonks.org/ Someone asked me how to count to 10 in Perl: push@A,$_ for reverse q.e...q.n.;for

Re: Fwd: passing variables in POST

2002-06-25 Thread Ovid
g to that. Remember, when dealing with security, you can't trust *anything* outside of your box. Cheers, Curtis "Ovid" Poe = "Ovid" on http://www.perlmonks.org/ Someone asked me how to count to 10 in Perl: push@A,$_ for reverse q.e...q.n

Re: passing variables in POST

2002-06-25 Thread Ovid
1:08:52:14 -0800] "GET /cgi-bin/test.cgi?name=Ovid&password=youwish HTTP/1.1" 200 633 Here's a typical post request, one which *did* have data sent: 127.0.0.1 - - [20/Nov/2001:17:07:43 -0800] "POST /cgi-bin/test.cgi HTTP/1.1" 200 462 Since POST data is read from

Re: Fwd: passing variables in POST

2002-06-25 Thread Ovid
--- Niko Gunadi <[EMAIL PROTECTED]> wrote: > >thanks very much Ovid, it was very nice of you, but can you complete your > >favour and describe how to implement Apache::Session, i mean, whats the use > >of that module if i could generate a session id with md5? >

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

2002-07-01 Thread Ovid
> Thanks, > David David, Just a reminder regarding posting your alternative to CGI.pm (and thanks to niko for reminding me to remind you :) Cheers, Curtis "Ovid" Poe = "Ovid" on http://www.perlmonks.org/ Someone asked me how to count to 10 in Perl: push@A,$_

Re: 2 Questions

2002-07-02 Thread Ovid
#!/usr/bin/perl -w use strict; use Data::Dumper; my $hash_ref = do ( 'test.dat' ) or die "Cannot open test.dat: $!"; print Dumper $hash_ref; The above form of 'do' is a special form that "evals" the contents of the file. The last thing returned from t

Re: Form.pm

2002-07-02 Thread Ovid
wrong, but we should say that with a smile on our face :) I've glanced through the code and I see a few things that warrant attention. I'll comment later when I have a bit more time. I do have to say, though, that despite some obvious issues, this is some of the nicest "hand-

Re: Form.pm

2002-07-03 Thread Ovid
would disagree because of the limitations in your code. For example, how many times do we see stuff like the following: print "Content-type:text/html\n\n"; print "ContentType: text/plain\n\n"; print "Set-Cookie: name=Ovid; expires=Friday,31-Dec-02 23:59:59 GMT; d

Re: Form.pm

2002-07-03 Thread Ovid
the creator of CGI.pm David, You have an old version of CGI.pm. From later versions (this pulled from 2.74): my(@pairs) = split(/[&;]/,$tosplit); Cheers, Curtis "Ovid" Poe = "Ovid" on http://www.perlmonks.org/ Someone asked me how to count to 10 in Perl: pus

Re: 2 Questions

2002-07-03 Thread Ovid
Kyle, That's because, with the example I sent, you are populating a hashref with the 'do' statement. You don't have any scalar called $name. Change this: our($name); chicken To this: $hash_ref->{name} chicken Also, you probably will want to read "perl

Re: Username & Password Question

2002-07-03 Thread Ovid
sually being something like "\r\n" or "\n". Since that's at the end of each scalar you're reading, your split is acting like some weird chomp. As for your actual, question, I'm going to sidestep it (as others have answered already) and suggest that you read h

Re: Form.pm

2002-07-03 Thread Ovid
th the proper solution, or give me a url where I could see >an example. split(/[&;]/,$tosplit); Cheers, Curtis "Ovid" Poe = "Ovid" on http://www.perlmonks.org/ Someone asked me how to count to 10 in Perl: push@A,$_ for reverse q.e...q.n.;for(@A){$_=unpack(q|c|,

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

2002-07-05 Thread Ovid
ontent length is greater than zero are good examples. Much of the rest of the code has issues similar to what I've outlined above. I would also strongly recommend breaking your subroutines up into much smaller chunks. They're easier to understand that way. Cheers, C

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

2002-07-08 Thread Ovid
ch the correct data where it may or may not be wrapped in quotes. This: /name=\"{0,1}.../ is the same as: /name="?.../ And the second example is also easier to read. Cheers, Curtis "Ovid" Poe = "Ovid" on http://www.perlmonks.org/ Someone asked me how to cou

Re: HTML tags - module

2002-07-17 Thread Ovid
do { $token = $p->get_token; } until ( $token->is_start_tag( 'body' ) ); while ( my $token = $p->get_token ) { next unless $token->is_text; # skip non-visible stuff print $token->return_text; } Cheers, Curtis "Ovid" Poe = "Ovid"

Re: Checking Form data

2002-07-30 Thread Ovid
gt; Thanks Answering what I think you're asking: Client-side validation (javascript) is fine for avoiding an unnecessary trip to the server, but it's easily avoided -- you can just turn javascript off. Therefore, server-side validation is mandatory lest you open up security hole

Re: Redirect and cookies

2002-08-31 Thread Ovid
long-standing bug in version 3.0, 4.0, and 5.0 where you cannot set a cookie and do a redirect at the same time unless you switch to non-parsed header scripts. http://support.microsoft.com/default.aspx?scid=KB;EN-US;Q176113 Cheers, Curtis "Ovid" Poe = "Ovid" on http://w

RE: Redirect and cookies

2002-09-02 Thread Ovid
just to make sure you're handling it correcty, with IIS, the script name must begin with "nph-". Cheers, Curtis "Ovid" Poe = "Ovid" on http://www.perlmonks.org/ Someone asked me how to count to 10 in Perl: push@A,$_ for reverse q.e...q.n.;for(@A){$_=unpac

Re: Mystery number 1 in output

2002-10-10 Thread Ovid
. print returns a result letting you know if the print succeeded or not. That's what you're printing. Here's a test case: perl -e 'print print "Ovid"' That prints Ovid1 Cheers, Ovid = "Ovid" on http://www.perlmonks.org/ Someone

Re: CGI.pm param question

2002-10-23 Thread Ovid
o, this is easy. The CGI::hidden function will conveniently output all of the hidden fields necessary to contain your form values. Here's a two-line demonstration: use CGI qw/:standard/; print hidden( $_ ) foreach param(); Save that as 'test.pl' and run it as follows:

Re: How can I solve this error?

2002-11-09 Thread Ovid
is missing, and where could I find it? > I hope it won't be necessary to install a full C compiler. Teddy, Hate to break it to you, but cl.exe is the name of Microsoft's C/C++ compiler :) Cheers, Ovid = "Ovid" on http://www.perlmonks.org/ Someone asked me how to count t

Re: How can I solve this error?

2002-11-09 Thread Ovid
Hmmm... I just answered a four day old email message, didn't I? :) Cheers, Ovid (who never did Y2K work because he obviously can't find a date) --- Ovid <[EMAIL PROTECTED]> wrote: > --- Octavian Rasnita <[EMAIL PROTECTED]> wrote: > > Hi all, > > > >

Re: How can I solve this error?

2002-11-10 Thread Ovid
hing for PPM of the module you wish to use, or post help messages to CLPM, Perlmonks, or other resources in an effort to find a PPM. It would be much easier that way. Cheers, Ovid = "Ovid" on http://www.perlmonks.org/ Someone asked me how to count to 10 in Perl: push@A,$_ for r

Re: perl/DBI error

2002-11-10 Thread Ovid
your DBI constructor has the RaiseError attribute set. This will ensure that errors will always be reported so you don't have to worry as much about always checking the return value of all DBI calls. Cheers, Ovid = "Ovid" on http://www.perlmonks.org/ Someone asked me how to co

Re: tutorials

2002-11-24 Thread Ovid
> Thanks You can also check out http://users.easystreet.com/ovid/cgi_course I assume that you already know Perl and know *some* HTML, but that's about it. I think it's fairly easy to read and has gotten some good reviews. Let me know what you think. Cheers, Ovid = "Ovid&

Re: Re: tutorials

2002-11-25 Thread Ovid
was too small (on earlier incarnations of the site). Cheers, Ovid = "Ovid" on http://www.perlmonks.org/ Web Programming with Perl: http://users.easystreet.com/ovid/cgi_course/ Silence Is Evil: http://users.easystreet.com/ovid/philosophy/decency.txt

Re: tutorials

2002-11-25 Thread Ovid
ikely, but the broken code above will not parse it. Not that I blame the author, mind you, or the people who read it without understanding the implications, but code like this should not be used except as an example of why it doesn't work. You can find more detail at lesson two of my C

Re: tutorials

2002-11-26 Thread Ovid
y attacker as a result. Of course, if they follow advice presented in my course, or in any of the (relatively few) excellent books on the subject, this is much less likely. Cheers, Ovid = "Ovid" on http://www.perlmonks.org/ Web Programming with Perl: http://users.easystreet.com/ovid/

Re: Guestbook script problem

2002-11-27 Thread Ovid
you are printing your content-type header multiple times. You'll only need to print in once. You can also use your CGI object for this: print $q->header; See my CGI course for more information on this (link at bottom of email). Good luck with your programming! Cheers, Ovid =

Re: image upload

2002-12-26 Thread Ovid
have the HTML form done: use CGI qw(:standard); my $fh = param('upload_form_name'); print while <$fh>; The documentation will give you far more detail on how to handle this. Cheers, Ovid = "Ovid" on http://www.perlmonks.org/ Web Programming with Perl: http

Re: image upload

2002-12-26 Thread Ovid
ntioned earlier, you should check out the CGI.pm documentation (http://users.easystreet.com/ovid/cgi_course/appendices/appendix3.html#creating%20a%20file%20upload%20field). 'cgi-lib.pl' has been deprecated for years. The following snippet should give you a start. If you are on a Wi

Re: image upload

2002-12-26 Thread Ovid
--- Ovid <[EMAIL PROTECTED]> wrote: > you are on a Windows system, you'll also want to see 'perldoc -f binmore' Erm, I meant 'perldoc -f binmode' :) Cheers, Ovid = "Ovid" on http://www.perlmonks.org/ Web Programming with Perl: http://users.eas

Re: directory help

2003-03-22 Thread Ovid
open was successful. I should also add that the standard way of handling this is to use the File::Find module. See 'perldoc File::Find' for more information. Cheers, Ovid = "Ovid" on http://www.perlmonks.org/ Web Programming with Perl: http://users.easystreet.com/ov

Re: Premature end of script headers

2003-03-24 Thread Ovid
did you run it through a Web server. Each can behave significantly different from the other one. Cheers, Ovid = "Ovid" on http://www.perlmonks.org/ Web Programming with Perl: http://users.easystreet.com/ovid/cgi_course/ Silence Is Evi

Re: Premature end of script headers

2003-03-24 Thread Ovid
=~ tr/+/ /; > $value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg; > $FORM{$name} = $value; > } Numerous bugs here. Rather than go through all of them, I'll just post a link to my course where I detail them: http://users.easystreet.com/ovid/cgi_course/lesso

Re: Why not Class Objects

2003-06-27 Thread Ovid
sky people insist upon having 3 for the value of PI. All of a sudden, it's cleaner to be able to override this. Class::Data::Inheritable allows you to do that. Cheers, Ovid = Hire me! http://users.easystreet.com/ovid/personal/resume.html Ovid

RE: Getting the domain name

2003-07-17 Thread Ovid
ttp://foo.co.uk/ https://www.host.com/ There are plenty of other things I could toss out that cause issues here. Cheers, Ovid = Hire me! http://users.easystreet.com/ovid/personal/resume.html Silence is Evil http://users.easystreet.com/ovid/philosophy/indexdecen

  1   2   >