Thanks for hint Mike. I think now I will be able to proceed.

-----Original Message-----
From: Mike Ward [mailto:m...@farematrix.com] 
Sent: Thursday, January 08, 2009 9:59 PM
To: beginners@perl.org
Subject: Re: How to know no. of times the script has been executed?

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/


http://www.patni.com
World-Wide Partnerships. World-Class Solutions. 
_____________________________________________________________________ 

This e-mail message may contain proprietary, confidential or legally privileged 
information for the sole use of the person or entity to whom this message was 
originally addressed. Any review, e-transmission dissemination or other use of 
or taking of any action in reliance upon this information by persons or 
entities other than the intended recipient is prohibited. If you have received 
this e-mail in error kindly delete this e-mail from your records. If it appears 
that this mail has been forwarded to you without proper authority, please 
notify us immediately at netad...@patni.com and delete this mail.
_____________________________________________________________________

-- 
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