On 7/5/07, herostar1981 <[EMAIL PROTECTED]> wrote:
for (my $i=0;$i<=$#data;$i++)
{ $kml.="<Folder><open>0</open><name>station</name>".
$sta[$i]."</Folder>";}
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?
Most uses of the computed for loop, like that one, are simpler as a
foreach loop in Perl:
foreach my $i (0..$#data) { ... }
Or even this:
foreach my $element (@data) { ... }
At this point, if I use following script, I can work as I wish:
print "Content-type: text/html\n\n";
print $kml;
if I use "print FID $kml;", the trouble is coming...
What trouble? Are you saying that $kml printed to a file is different
than $kml rendered in a web browser, or what?
Good luck with it!
--Tom Phoenix
Stonehenge Perl Training
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/