CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Beginner:
open file

 



thermal
Deleted

Mar 3, 2000, 11:29 AM

Post #1 of 19 (2783 views)
open file Can't Post

wrote a program to read and parse
using the "GET" method
problem is this:
uploaded nm.pl to read and parse and save comments to uploaded blank file nm.log
WHEN i go to retrieve info in the nm.log
NOTHING is there???
example:
open(JUMBO, ">>koolnthermal/cgi-gin/nm.log")
HELP PLEASE


Cure
User

Mar 3, 2000, 11:42 AM

Post #2 of 19 (2783 views)
Re: open file [In reply to] Can't Post

Hi thermal

To read and parse your info use the CGI.pm
And can you post your script so I can help you with it.

Cure

[This message has been edited by Cure (edited 03-03-2000).]


thermal
Deleted

Mar 3, 2000, 11:58 AM

Post #3 of 19 (2783 views)
Re: open file [In reply to] Can't Post

CURE..WOW....thanks for fast response.
until i have a full understanding of PERL..i do not want to use the CGI.pm's yet.

as stated...i can read, parse, open, write, append..to a file under DOS with my program.

the problem is opening a file on the ISP??
may i email you my program it is simple and short???


Cure
User

Mar 3, 2000, 12:03 PM

Post #4 of 19 (2783 views)
Re: open file [In reply to] Can't Post

Hi thermal::

Of course you can email me your program..

cure@texas.net

Cure


thermal
Deleted

Mar 3, 2000, 12:10 PM

Post #5 of 19 (2783 views)
Re: open file [In reply to] Can't Post

CURE...thank U.....email and file sent...await your reply....hope you are getting PAID for this.......


Cure
User

Mar 3, 2000, 1:24 PM

Post #6 of 19 (2783 views)
Re: open file [In reply to] Can't Post

Here you go::

#!/usr/bin/perl

$e = $ENV{'QUERY_STRING'};
@b = split(/[&;]/, $e);


foreach $i (0..$#b)
{
open(HAMBO, ">>koolnthermal/nm.log") | | die("cannot open");

$b[$i] =~ s /\+/ /g;
($key, $val) =split(/=/,$b[$i],2);

$key =~ s/%(..)/pack("c",hex($1))/ge;
$val =~ s/%(..)/pack("c",hex($1))/ge;
print HAMBO "$key: $val \n";



}


close HAMBO;
print "Content-type: text/html \n";
print qq~
<html>
<head>
<title>Thank You</title>
</head>
<body background = C1.BMP>
<h3><FONT SIZE=5 COLOR=#00FFFF> Thank you for your business </FONT>
<h2> Come back again when you have <em>LESS</em> time
<h5> Please allow 4-6 weeks delivery
</body>
</html>
~;


Cure




thermal
Deleted

Mar 3, 2000, 2:15 PM

Post #7 of 19 (2783 views)
Re: open file [In reply to] Can't Post

CURE......copied and pasted your changes......still got of the...error message...sent you email....here is.....error message:

"misbehaved...not returning a complete set of HTTP headers........headers returned are:
cannot open at d:\inetpub\wwwroot\users\koolnthermal\cgi-bin\nm.pl line 9"


Cure
User

Mar 3, 2000, 4:15 PM

Post #8 of 19 (2783 views)
Re: open file [In reply to] Can't Post

Hi

The code works for me anyways I fixed the header problem-> this should work

#!/usr/bin/perl

$e = $ENV{'QUERY_STRING'};
@b = split(/[&;]/, $e);


foreach $i (0..$#b)
{
open(HAMBO, ">>koolnthermal/nm.log") or die("cannot open");

$b[$i] =~ s /\+/ /g;
($key, $val) =split(/=/,$b[$i],2);

$key =~ s/%(..)/pack("c",hex($1))/ge;
$val =~ s/%(..)/pack("c",hex($1))/ge;
print HAMBO "$key: $val \n";

}


close HAMBO;
print "Content-type: text/html\n\n";

print qq~
<html>
<head>
<title>Thank You</title>
</head>
<body background = C1.BMP>
<h3><FONT SIZE=5 COLOR=#00FFFF> Thank you for your business </FONT>
<h2> Come back again when you have <em>LESS</em> time
<h5> Please allow 4-6 weeks delivery
</body>
</html>
~;


Cure


thermal
Deleted

Mar 3, 2000, 10:18 PM

Post #9 of 19 (2783 views)
Re: open file [In reply to] Can't Post

CURE:......U....are one KOOL...dude.......thank you for your assistance......in solving my PERL script(too much)......"shade me a little ..slack".....HUH???


Cure
User

Mar 3, 2000, 10:37 PM

Post #10 of 19 (2783 views)
Re: open file [In reply to] Can't Post

Your Welcome thermal

Cure


thermal
Deleted

Mar 4, 2000, 1:20 AM

Post #11 of 19 (2783 views)
Re: open file [In reply to] Can't Post

CURE........to make certain of no error i just copied and pasted your input.
STILL get the same error message regarding line 9 which is the open file.
sent you email of the error message.

[This message has been edited by thermal (edited 03-04-2000).]


Cure
User

Mar 4, 2000, 6:31 AM

Post #12 of 19 (2783 views)
Re: open file [In reply to] Can't Post

Hi

change this line #!/usr/bin/perl TO #!/perl5/bin/perl

Cure


thermal
Deleted

Mar 6, 2000, 6:34 PM

Post #13 of 19 (2783 views)
Re: open file [In reply to] Can't Post

CURE.......another problem did arise....sent of you the.........email....await your response.......plz......YOU ALWAYS the....CURE......HUH???


Cure
User

Mar 6, 2000, 8:07 PM

Post #14 of 19 (2783 views)
Re: open file [In reply to] Can't Post

Hi

I didnt know it was NT. I thought it was unix. Most web servers are on unix so i
assumed it was unix. I cant help you with NT. I have never used NT..

Cure



Cure
User

Mar 8, 2000, 6:48 PM

Post #15 of 19 (2783 views)
Re: open file [In reply to] Can't Post

Hi Thermal::

You see I was right->it was your isp and not your perl script,hhhehehhe


Cure


thermal
Deleted

Mar 8, 2000, 8:36 PM

Post #16 of 19 (2783 views)
Re: open file [In reply to] Can't Post

U......da MAN.........U...da......CURE.........i did not like you answer but YES YES YES YES......U.........were TOTAL CORRECT....thank you .....dude....for those out there who have my problem....if you are a sub-domain(.net.net)U may not be able to run your PERL scripts...CURE he did teach me....HUH!!!!!!


Cure
User

Mar 9, 2000, 1:43 PM

Post #17 of 19 (2783 views)
Re: open file [In reply to] Can't Post

Your Welcome Thermal:

Cure


thermal
Deleted

Mar 9, 2000, 1:57 PM

Post #18 of 19 (2783 views)
Re: open file [In reply to] Can't Post

is not /[Tt]ermal/ is..........thermal


thermal
Deleted

Mar 9, 2000, 1:58 PM

Post #19 of 19 (2783 views)
Re: open file [In reply to] Can't Post

is not /[Tt]hermal/ is..........thermal

 
 


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives