Check if file is open in unix

2010-11-23 Thread Gopal Karunakar
Hi All, I want to check whether a particular file (a simple text file) is open in the UNIX environment. i.e. I want to make sure that its not getting written into by some other process before my Perl process open it. So that it will always get a complete file. Is there some way of making sure

Using the Time::localtime module??

2010-10-08 Thread Gopal Karunakar
Hi All, I am using the Time::localtime module in my perl script for getting a particular date format. It was working fine till last month, but for the month of October it is seen that it's showing as September. I am pasting a copy of my code below: sub getLocalTime { my $tm = localtime; my

Re: Using the Time::localtime module??

2010-10-08 Thread Gopal Karunakar
Thank you very much the help. And thanks very much for all your inputs!! I'll keep all these suggestions in mind in the future and hopefully write better code in the future. On 8 October 2010 15:56, Shlomi Fish shlo...@iglu.org.il wrote: Hi GK, On Friday 08 October 2010 10:02:34 Gopal

Interrupt Handling

2010-09-22 Thread Gopal Karunakar
Hi All, I used the $SIG{'INT'} = 'IGNORE'; in a sub in my script so that the script while executing the particular sub will ignore the ctrl-c. And I gave $SIG{'INT'} = 'DEFAULT'; at the end of the sub to reset the behavior back to normal. But when i give the ctrl-c the process seems to be

Re: Interrupt Handling

2010-09-22 Thread Gopal Karunakar
...@gmail.com wrote: On Sep 22, 6:53 am, gk.kalipuray...@gmail.com (Gopal Karunakar) wrote: I used the $SIG{'INT'} = 'IGNORE'; in a sub in my script so that the script while executing the particular sub will ignore the ctrl-c. And I gave $SIG{'INT'} = 'DEFAULT'; at the end of the sub

Re: Interrupt Handling

2010-09-22 Thread Gopal Karunakar
.sql file. Cheers, Parag On Wed, Sep 22, 2010 at 11:04 AM, Gopal Karunakar gk.kalipuray...@gmail.com wrote: Hi, Here's the code pasted below. The sub basically executed an anonymous pl/sql block (which is executing fine). I want to make sure that the user will not be able to a ctrl-c

Re: Interrupt Handling

2010-09-22 Thread Gopal Karunakar
2010 03:32, John W. Krahn jwkr...@shaw.ca wrote: [ Please do not top-post. TIA ] Gopal Karunakar wrote: Hi, Hello, Here's the code pasted below. The sub basically executed an anonymous pl/sql block (which is executing fine). I want to make sure that the user will not be able

Re: Parse numeric string

2010-06-16 Thread Gopal Karunakar
You can try using sprintf function to treat the numeric as string.. On 15 June 2010 21:10, mrwawa wade.w...@gmail.com wrote: Hi all, I am new to Perl and am trying to do the following. I have a dataset file with the following example structure. ACRU 12 34 QUAL 28 90 QURU

Perl file with arguments

2010-06-09 Thread Gopal Karunakar
Hi, How can i declare a simple perl script file which will take arguments from the user? an example will be take two numbers and give the sum as output. Thanks in advance, GK.

Find duplicates in an array

2010-06-02 Thread Gopal Karunakar
Hi All, I needed to find all the duplicate values in an array and their count of occurences. Any help would be appreciated . Thanks in advance.