as i say I'm just a beginner so i hope this makes sense!
Cheers S
Sorry i forgot to say i dont have a clue where to start. can somone
cive me some pointers or some code to work with?
That guy is multi-posting: http://www.thescripts.com/forum/thread577410.html
--
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl
>> I'm trying to write code
If you show us what you have so far, we can help you fix and extend it.
>> that takes two texts submitted from an html form
[snip]
> Sorry i forgot to say i dont have a clue where to start.
Start with writing a program that can get 2 texts submitted from an html form.
Then write a program that can compare the 2 texts taken from the form.
Then write a program that counts when the texts compare equally.
Then...
> can somone
> cive me some pointers or some code to work with?
Here is the first program mentioned above (untested):
use CGI qw/:standard/;
my $text1 = param('text1');
my $text2 = param('text2');
print "I have gotten '$text1' and '$text2'\n";
Here is the second one:
use CGI qw/:standard/;
my $text1 = param('text1');
my $text2 = param('text2');
print "'$text1' and '$text2' are equal\n" if $text1 eq $text2;
You almost certainly could have gotten that far had you tried...
--
Tad McClellan SGML consulting
ta...@augustmail.com Perl programming
Fort Worth, Texas
Sorry I didnt realise this war rude.
Thanks I do have some code and its simmilar to yours but mine wont run.
Im posting from my phone on the way home so i'll post my code tomorrow
morning aswell as try yours.
cheers c
Here is the first program mentioned above (untested):
use CGI qw/:standard/;
my $text1 = param('text1');
my $text2 = param('text2');
print "I have gotten '$text1' and '$text2'\n";
Here is the second one:
use CGI qw/:standard/;
my $text1 = param('text1');
my $text2 = param('text2');
print "'$text1' and '$text2' are equal\n" if $text1 eq $text2;
You almost certainly could have gotten that far had you tried...
Thanks I do have some code and its simmilar to yours but mine wont run. Im posting from my phone on the way home so i'll post my code tomorrow morning aswell as try yours.A couple of things the above leaves out. Assuming you're running this on a web server...
use CGI qw/:standard -debug/;
my $text1 = param('text1');
my $text2 = param('text2');
print "I have gotten '$text1' and '$text2'\n";
Now the debugging session:
perl -d foo.cgi "text1=Hello World" "text2=How are you"The "n" command tells the Perl debugger to "step over" the next Perl statement. We do this because if we did "s" for step we'd step into the param call and be debugging the CGI.pm module. You probably don't want to do that! Next the "p" command prints a variable. As you can see $text1 is now set to "Hello World". If we p $text2 nothing comes out. Because we haven't stepped over the second param call thus $text2 is undefined at this moment. The "x" command prints out data structures like hashes and arrays. Additionally it prints "undef" if the variable is undefined. Next we step over (n command) the second param call then examine $text2 using the "x" command this time. Finally we "c" continue ending the program.
Loading DB routines from perl5db.pl version 1.27
Editor support available.
Enter h or `h h' for help, or `man perldebug' for more help.
main::(foo.cgi:2): my $text1 = param('text1');
DB<1> n
main::(foo.cgi:3): my $text2 = param('text2');
DB<1> p $text1
Hello World
DB<2> p $text2
DB<3> x $text2
0 undef
DB<4> n
main::(foo.cgi:4): print "I have gotten '$text1' and '$text2'\n";
DB<4> x $text2
0 'How are you'
DB<5> c
I have gotten 'Hello World' and 'How are you'
Debugged program terminated. Use q to quit or R to restart,
use O inhibit_exit to avoid stopping after program termination,
h q, h R or h O to get additional info.
DB<5> q
--Andrew DeFaria
Thescripts.com is a completely different forum from clpm. There is no
reason to suspect that a significant portion of readers of clpm also
read thescripts.com.
Asking a question on both clpm and thescripts.com is like asking a
lawyer for an opinion then getting a second opinion from another lawyer.
I can see where some people think that posting the same thing on usenet
twice in different groups is rude, but saying that someone can't post
the same thing in two different places anywhere on the Internet doesn't
make any sense to me.
--
paduille.4...@earthlink.net
http://home.earthlink.net/~mumia.w.18.spam/
>Asking a question on both clpm and thescripts.com is like asking a
>lawyer for an opinion then getting a second opinion from another lawyer.
Yet it would be fine to point out having done so, and possibly report
to any of the resources interesting info got from the other one...
Michele
--
{$_=pack'B8'x25,unpack'A8'x32,$a^=sub{pop^pop}->(map substr
(($a||=join'',map--$|x$_,(unpack'w',unpack'u','G^<R<Y]*YB='
.'KYU;*EVH[.FHF2W+#"\Z*5TI/ER<Z`S(G.DZZ9OX0Z')=~/./g)x2,$_,
256),7,249);s/[^\w,]/ /g;$ \=/^J/?$/:"\r";print,redo}#JAPH,
I agree. But how would that justify multi-posting? On the contrary, just
that fact increases the risk that somebody here spend time on an answer
without knowing that the problem already was resolved over there (or
vice versa).
The OP's explanation at thescripts.com:
"I posted in multiple forms because different people visit different
forums and I want as much help as i can get."
reveals an inconsiderate view on how to (ab)use the free resources for
seeking help with Perl.
> Asking a question on both clpm and thescripts.com is like asking a
> lawyer for an opinion then getting a second opinion from another lawyer.
There is a huge difference: The person who asks two lawyers for advice
get two bills, i.e. s/he pays for the services.
> I can see where some people think that posting the same thing on usenet
> twice in different groups is rude, but saying that someone can't post
> the same thing in two different places anywhere on the Internet doesn't
> make any sense to me.
Please allow me to disagree. The OP took the point and apologised, so I
was kind of surprised to see you defend him. ;-)
Usually it's enough to just say where you've also asked this question
and to provide a link to it. That way someone doesn't spend a lot of
time typing an answer that you've already received elsewhere.
To be extra nice, you can go back to the places you posted and provide
links to the answers you got elsewhere.
Good luck :)
--
Posted via a free Usenet account from http://www.teranews.com