Use a batch file with embedded perl.  Batch reads and executes one line at
a time, so it can update itself before executing the next line, as well as
any embedded perl.



   @REM='
   @ECHO OFF
   REM -={ All lines following COPY will be executed from the updated
   script }=-
   COPY "\\MasterServer\Scripts\ThisFile.Bat" "%~f0"
   PERL -x "%~f0" %*
   GOTO :EOF
   ';

   #!perl
   # ...

   __END__


If you have to use binaries you could do this with two executables, where
one updates the other and executes it.

hth
Tony




                                                                                       
                                                    
                    "Wheldon,M"                                                        
                                                    
                    <[EMAIL PROTECTED]>              To:     
"'[EMAIL PROTECTED]'"                       
                    Sent by:                                     
<[EMAIL PROTECTED]>                               
                    [EMAIL PROTECTED]      cc:                     
                                                    
                    eState.com                                 Subject:     
replacement of executing script.                               
                                                                                       
                                                    
                                                                                       
                                                    
                                                                                       
                                                    
                    05/27/02 04:51 AM                                                  
                                                    
                                                                                       
                                                    
                                                                                       
                                                    



Hi,

           I have a perl script needs to replace its self when a newer
version
is available so I turned it into an executable, thinking that it would be
run from memory rather than from the disk, however this appears not to be
the case.
           Straight after renaming the original executable the download via
ftp
of the new version fails, with the error.

Error cannot open source file.

Hope you can help

Martin
_______________________________________________
Perl-Win32-Admin mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs




_______________________________________________
Perl-Win32-Admin mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to