try to change the shebang to #!/bin/sh

first of all: you shouldn't use the backticks `` if you dont want to
have the output of the program.

2nd: don't use touch, chmod, etc... there are many ways to do it much
faster in perl. everytime you do somethink like that you invoke a
fork() and start a new process only to do somethink that perl easily
can do for you.

3rd: it's better do make

open(...) or die(...);

or:

open(...) or warn(...);

so you notice if your open() didnt work.

HTH

On Fri, 08 Jun 2007 06:27:39 -0700
herostar1981 <[EMAIL PROTECTED]> wrote:

> Hi everybody,
>    I have a perl script, which can write some message to a new file,
> looks like the following.
> 
> my $cmd="touch /data3/OGCserver-xu/htdocs/tmp/$time".".kml";
> `$cmd`;#`touch ../../htdocs/tmp/xuhuanxiang.kml`;
> `chmod 777 /data3/OGCserver-xu/htdocs/tmp/$time.kml`;
> open (XHX,">","/data3/OGCserver-xu/htdocs/tmp/$time.kml") ;
> #print "Content-Type: application/vnd.google-earth.kml+xml\n\n";
> print $kml;
> -------------------------------------------------------------------- 1
> print XHX $kml;close XHX;
> -------------------------------------------------------------------2
> 
> The script does work well on a webpage, but it only write a part of
> the message to the file on another webpage.
> 
> Can anybody help me?
> 
> Best Regards,
> xu
> 
> 

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/


Reply via email to