sanket vaidya wrote:

>  
> Hi all,
>  
> I want to do something like this.
>  
> Invoke a cmd (using system command) print a welcome message & execute the
> remaining part of script.
>  
> Now what I want is
> 1. cmd should only be invoked with welcome message if the script is
> executed first time.
> 2. I want the remaining part of script to be executed till we exit the cmd
> session.
>  
> e.g.
>  
> script.pl
>  
> system 'start cmd /k echo Welcome'
>  
> {
>  
> remaining part of script
>  
> }
>  
> cmd should be invoked only once at start of session & the remaining part
> should be executed till the end of session.
>  
> Any hints. How to do that?

I'd just store the number of times it's been run in a .file in the home
directory (/home/user/.myscript). If the file doesn't yet exist, then it's
the first time the script has run. Otherwise read the number from the file,
and increment it.

-- 
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/


Reply via email to