-
May 30th, 2007, 05:42 PM
#1
Getting Started with Pearl
I just got started learning Pearl, and I am trying to get my first script to work. Unfortunately, it does not even run! When I click the "submit" button on the html form, it opens up the Pearl code as text, rather than running it. What am I doing wrong? Thanks!
-
May 30th, 2007, 05:43 PM
#2
Re: Getting Started with Pearl
Well, step one is I should learn to spell Perl . . .
-
May 30th, 2007, 06:11 PM
#3
Re: Getting Started with Pearl
Is your code small? You could paste it here. Make sure it is between <?php ?> tags.
If you're going to post the code here. Use the [ PHP ] [ /PHP ] (without spaces between the brackets and "PHP"). You can use the PHP button to format the code properly with syntax-highlighting . You can always preview your post before posting.
Last edited by bubu; May 30th, 2007 at 06:13 PM.
All consequences are eternal in some way.
-
May 30th, 2007, 08:02 PM
#4
Re: Getting Started with Pearl
#!C:/pearl/bin/perl.exe
use CGI;
$query = new CGI;
$v0= $query->param('v0') ;
$v01= $query->param('v01') ;
$v02= $query->param('v02') ;
$v03= $query->param('v03') ;
$v04= $query->param('v04') ;
$v05= $query->param('v05') ;
$v06= $query->param('v06') ;
$v07= $query->param('v07') ;
$v08= $query->param('v08') ;
$v09= $query->param('v09') ;
($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime(time);
$year = 1900 + $year;
$mon= $mon+1;
$hour = $hour - 1;
$date1= "$mon/$mday/$year";
$date2= "$hour:$min:$sec";
print $query->header;
print $query->start_html(-title=>'Thank you');
print "<style type='text/css'>
body{
margin: 20;
padding: 0;
font-size: 90%;
font-family: arial;
color: 'white';}
</style>";
open(INFO, ">>$ENV{'DOCUMENT_ROOT_OLD'}/www/data/output.txt");
print INFO "$v01,$v02,$v03,$v04,$v05,";
print INFO "endline\n";
close (INFO);
print "Thank you for your responses! <BR><BR>";
print $query->end_html;
-
May 30th, 2007, 09:46 PM
#5
Re: Getting Started with Pearl
Yeah, spelling PERL right is a good way to start. Notice your code...
Code:
#!C:/pearl/bin/perl.exe
As Bubu already mentioned, please use code tags when posting code. It makes it much easier to read a thread.
[code]
Your code goes here.
[/code]
Or
[php]
Your code goes here.
[/php]
Last edited by PeejAvery; May 30th, 2007 at 09:50 PM.
If the post was helpful...Rate it! Remember to use [code] or [php] tags.
-
May 31st, 2007, 04:10 PM
#6
Re: Getting Started with Pearl
I don't know much about PERL but I bet it would be easier to solve your problem if you tell us:
- your operating system
- how did you installed perl on it
- where is the script that you are running
- what is the ACTION parameter of the <form> that submits to the PERL page.
- can you execute any other PERL on your server?
thanks for attention.
All consequences are eternal in some way.
-
June 3rd, 2007, 01:12 AM
#7
Re: Getting Started with Pearl
- your operating system : Windows XP Tablet Edition
- how did you installed perl on it : normal location C:\Pearl\bin
- where is the script that you are running : C:\Documents and Settings\t\Desktop\sandbox\cgi-bin
- what is the ACTION parameter of the <form> that submits to the PERL page. : <FORM ACTION = 'cgi-bin/self-esteem-savedata.cgi' METHOD = 'post' >
- can you execute any other PERL on your server? : This is the only one I have tried.
Thanks!
-
June 3rd, 2007, 08:51 AM
#8
Re: Getting Started with Pearl
Since you are seeing just the perl text, that means one of two things. One, your installation is bad and the interpreter is not recognized. Two, you have invalidly typed the path to the interpreter. My guess is that the second is true.
In most cases, so long as you aren't making this a very custom install, the following should be your first line. Try it and then get back to us.
If the post was helpful...Rate it! Remember to use [code] or [php] tags.
-
June 4th, 2007, 12:18 AM
#9
Re: Getting Started with Pearl
I've tried many variations, and I'm still not getting it to work. I have a picture of my Perl installation at http://pantheon.yale.edu/~mis26/images/Perl.jpg.
It simply shows that perl.exe is in C:\Pearl\bin
-
June 4th, 2007, 07:34 AM
#10
Re: Getting Started with Pearl
If the post was helpful...Rate it! Remember to use [code] or [php] tags.
-
June 6th, 2007, 12:33 PM
#11
Re: Getting Started with Pearl
That is one of the ones I tried. I just tried it again, and got the same result: the text of the Perl comes up, but doesn't actually run. . .
-
June 6th, 2007, 12:57 PM
#12
Re: Getting Started with Pearl
I would suggest re-installing perl and stick with all the defaults. What server are you running? Have you thought of an all-in-one installer?
If the post was helpful...Rate it! Remember to use [code] or [php] tags.
-
June 6th, 2007, 08:14 PM
#13
Re: Getting Started with Pearl
I'll do a complete reinstall of everything when I have a chance, thanks for the help everyone, at least I know it's (probably) not a straightforward stupid thing I'm doing!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|