Re: a question write to file!

2007-07-06 Thread herostar1981
Thanks a lot... It's my fault, a big mistake Sorry, my $sta[0] is empty Because of the variables passed by html link. but when print to screen, I pass the right parameters. so awful Thanks again. Sorry. Best Regards, xu On 7 5 , 6 43 , [EMAIL PROTECTED] (Tom Phoenix) w

Re: a question write to file!

2007-07-05 Thread Tom Phoenix
On 7/5/07, herostar1981 <[EMAIL PROTECTED]> wrote: > What trouble? Are you saying that $kml printed to a file is > different than $kml rendered in a web browser, or what? yes, they are different. I don't know how to describe it.. Try this just before you print the variable, to the screen or t

Re: a question write to file!

2007-07-05 Thread herostar1981
please... this forum refresh so slowly On 7 5 , 1 06 , [EMAIL PROTECTED] (Tom Phoenix) wrote: > On 7/5/07, herostar1981 <[EMAIL PROTECTED]> wrote: > > > for (my $i=0;$i<=$#data;$i++) > > { $kml.="0station". > > $sta[$i]."";} > > That _might_ be correct. But why does the loop count th

Re: a question write to file!

2007-07-05 Thread herostar1981
> At this point, if I use following script, I can work as I wish: > print "Content-type: text/html\n\n"; > print $kml; 1station38a href=http://globec.whoi.edu>U.S.GLOBEC http://mapservice-xu.whoi.edu/globec.gif";> http://mapservice-xu.whoi.edu/maps-bin/globec-xu/map4>GEORGES BANK MAPSERVER http

Re: a question write to file!

2007-07-05 Thread Tom Phoenix
On 7/5/07, herostar1981 <[EMAIL PROTECTED]> wrote: for (my $i=0;$i<=$#data;$i++) { $kml.="0station". $sta[$i]."";} That _might_ be correct. But why does the loop count through the last element of the @data array, when you're processing the @sta array? And did you ever initialize $kml?

Re: a question write to file!

2007-07-05 Thread herostar1981
On 7 5 , 11 42 , [EMAIL PROTECTED] (T Baetzler) wrote: Thanks... The following loop is used to format the contents: for my $key (keys %station) { $sta[$k].="\n 0$key\n"."\n".$tmp_lev0[0][5].','. $tmp_lev0[0][4].",0\n \n"; } } And, this is used to finish the whole file content

Re: SOS: a question write to file!

2007-07-05 Thread herostar1981
I am sorry. Can you explain clearly? I don't know what's wrong. Your mean is the script code or the content I want to write to the file? Thanks a lot. Best Regards, xu On 7 5 , 11 35 , [EMAIL PROTECTED] (Tom Phoenix) wrote: > On 7/5/07, herostar1981 <[EMAIL PROTECTED]> wrote: > > > why are the

Re: SOS: a question write to file!

2007-07-05 Thread herostar1981
Thanks. But I can not understand you. Can you tell me the correct methods? I am not sure what's wrong. And I have spent the whole morning to find the mistake. Please help me... BR, xu On 7 5 , 11 35 , [EMAIL PROTECTED] (Tom Phoenix) wrote: > On 7/5/07, herostar1981 <[EMAIL PROTECTED]> wrote:

Re: SOS: a question write to file!

2007-07-05 Thread Tom Phoenix
On 7/5/07, herostar1981 <[EMAIL PROTECTED]> wrote: why are the contents different between what I write to file and what print in screen? Because of something in your source code. Cheers! --Tom Phoenix Stonehenge Perl Training -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional comma

RE: a question write to file!

2007-07-05 Thread Thomas Bätzler
herostar1981 <[EMAIL PROTECTED]> asked: > I have a big question. > why are the contents different between what I write to file > and what print in screen? Obviously you are doing something wrong ;-) If you want us to help you, please send a minimal code sample that demonstrates your prob

SOS: a question write to file!

2007-07-05 Thread herostar1981
Hi anybody, I have a big question. why are the contents different between what I write to file and what print in screen? I write a cgi script. In my opinion, it should write some information into file which locates /htdocs/tmp. But I don't know what happened. It can print in terms of htm