help in while loop

2008-03-17 Thread Irfan.Sayed
Hi All, Can somebody please let me know the meaning of this line. while (<$in>) { if(/,/) {print "before match: $`\t and after match: $'\n\n";}; $x=$'; $y=$`; &mysubroutine($x,$y); } I know it is a while loop for the file handle ($in) and it will be executed till the end of file b

diff of two files

2008-03-17 Thread Irfan.Sayed
Hi All, I want to compare the two files in Perl. The requirement is that file 1 has 20 lines and file2 has 25 lines . I want to see only five lines as output which are there in file2 not in file1 as I know that rest of the 20 lines are same in both the files. I am using the following commands

RE: diff of two files

2008-03-20 Thread Irfan.Sayed
Hi All, Can somebody please help me on this??? Regards, Irfan -Original Message- From: Sayed, Irfan Sent: Monday, March 17, 2008 7:52 PM To: beginners@perl.org Subject: diff of two files Hi All, I want to compare the two files in Perl. The requirement is that file 1 has 20 lines a

RE: diff of two files

2008-03-24 Thread Irfan.Sayed
No it is not a homework. It's a official script which I want to make it into production??? Please help. Regards, Irfan -Original Message- From: Ken Foskey [mailto:[EMAIL PROTECTED] Sent: Thursday, March 20, 2008 1:48 PM To: beginners@perl.org Subject: RE: diff of two files Sounds like

reg ex

2008-04-15 Thread Irfan.Sayed
Hi All, I need help in regular expression. I have string as follows. OMS.FD.08.03.000.14 I need only OMS.FD.08.03.000 this much part of the string.i want to exclude .14 Please help. Regards, Irfan

setting unix command through perl script

2008-04-16 Thread Irfan.Sayed
Hi All, I need to execute the "export CCASE_NO_FILE_HEADER=yes" command through Perl script. What I did is qx(export CCASE_NO_FILE_HEADER=yes); but still the value for CCASE_NO_FILE_HEADER is not getting set to "yes" Regards, Irfan

RE: setting unix command through perl script

2008-04-16 Thread Irfan.Sayed
I tried the line : $ENV{CCASE_NO_FILE_HEADER} = 'yes'; But still the value is not getting set. Please help. Regards, Irfan Project Lead TSINDIA - Production Line Individual Software Solutions - UMO T-Systems India Private Limited, Pune Telephone: +91-20-30245000/25605000 (Extn: 5271) Mobile: +

log for script

2008-04-16 Thread Irfan.Sayed
Hi All, Is there any mechanism where I can take the log of entire Perl script. I mean to say that I need the log of each and every step which I am doing in Perl script. That step may include 1: input from user 2: internal Perl script commands Ultimately whatever Perl script is doing , I

RE: setting unix command through perl script

2008-04-17 Thread Irfan.Sayed
I want to execute "export CCASE_NO_FILE_HEADER=yes" command in Perl script. If I run this command on bash prompt then it is executing properly but if I try to execute this command through perl script then it is not executing at all How should I achieve this . is there any another way. Please help

RE: setting unix command through perl script

2008-04-17 Thread Irfan.Sayed
Hi, OK. Thanks. IS there any other mechanism to achieve this?? Regards, Irfan -Original Message- From: Martin Barth [mailto:[EMAIL PROTECTED] Sent: Thursday, April 17, 2008 1:01 PM To: beginners@perl.org Subject: RE: setting unix command through perl script Hi your "command" is execu

RE: setting unix command through perl script

2008-04-17 Thread Irfan.Sayed
Thanks for your help. Actually , I am automating one task in Perl in which this command is there. If I don't execute this command then entire task would fail. So it's very important that I should set this variable with proper value and then start the execution of the task. Regards, Irfan -O

RE: setting unix command through perl script

2008-04-17 Thread Irfan.Sayed
Thanks for your reply. I have run the command like this -> qx(CCASE_NO_FILE_HEADER=yes perl /home/m.belgaonkar/merge_latest.pl) bash: syntax error near unexpected token `qx(CCASE_NO_FILE_HEADER=yes' [EMAIL PROTECTED] ():/view/m.belgaonkar_oms_test/vob/oms [320] Please help. Regards, Irfan

help in reg. exp.

2008-04-21 Thread Irfan.Sayed
Hi All, I have string like OMS.FD.08.03.000.0 Now my req. is that if the string contains .0 at the end then I want to remove that .0 but if any other digit is there other than .0 then don't do anything. For example: if string is : OMS.FD.08.03.000.0 then regular expression should give OMS.F

how to check null value

2008-04-22 Thread Irfan.Sayed
Hi All, How to find out whether the string contains null values or empty data. For example : I have one scalar variable $str and now I want to check whether it contains any data or not. What I did : If ($str eq "NULL" || $str eq " "){ print $str conatins nothing\n";} Is this correc

Deletion of lines in file using perl

2008-04-23 Thread Irfan.Sayed
Hi All, I need to delete some lines in file using Perl. The requirement is that I have one file which contains following lines. Element * checkdout Element * latest. And now I want to delete these lines using Perl script. Please help. Regards, Irfan

Log error

2008-05-12 Thread Irfan.Sayed
Hi All, I have written once Perl script to perform certain task. In that script I have defined one function to create the log file. The issue is that whenever I am running that script it is executing fine but the moment it reaches to log () function it throws me following error. Can't t

Argument for perl script

2008-06-19 Thread Irfan.Sayed
Hi All, I am using @ARGV variable to record the argument passed to my Perl script. Now the requirement is that if I don't pass any argument to Perl script then it should show me following such output. Perl ack Usage: ack -name -pkg -relno

RE: Argument for perl script

2008-06-19 Thread Irfan.Sayed
Thanks a lot for all response. Regards Irfan. -Original Message- From: Mimi Cafe [mailto:[EMAIL PROTECTED] Sent: Thursday, June 19, 2008 6:34 PM To: beginners@perl.org Subject: Re: Argument for perl script You may have to parse @ARGV manually depending on how arguments are passed to yo

function call help

2008-07-09 Thread Irfan.Sayed
Hi All, I facing one issue in Perl script. I am executing one command in Perl script and taking the output of that command in one array. Now I want to execute some more commands on each value of the array. But the problem is that I am passing each value of the array as a argument to that

RE: function call help

2008-07-09 Thread Irfan.Sayed
Hi, Thanks for reply, but still the error is same. Following is script. #! /usr/bin/perl # Perl script to take the backup of critical clearcase data @vob_lst=system("/usr/atria/bin/cleartool lsvob -s"); foreach $a (@vob_lst) { lockvob($a); } sub lockvob() { local ($lockitem) = @_; print "

test mail

2008-10-13 Thread Irfan.Sayed
This e-mail and any files transmitted with it are for the sole use of the intended recipient(s) and may contain confidential and privileged information. If you are not the intended recipient, please contact the sender by reply e-mail and destroy all copies of the original message. Any unauth

Regarding reg. exp.

2008-10-13 Thread Irfan.Sayed
Hi All, I have a string and I need to parse that string to check whether it is in required format or not. I have a Perl script which ask for user input. I have mentioned in the Perl script that input should be in the following format. For example:- 1,2,3 OR 1 2 3 Which means that delimit

variable in perl

2008-10-14 Thread Irfan.Sayed
Hi All, Can somebody please tell me what is the meaning of $^X . Regards Irf. This e-mail and any files transmitted with it are for the sole use of the intended recipient(s) and may contain confidential and privileged information. If you are not the intended recipient, please contact th

RE: Regarding reg. exp.

2008-10-14 Thread Irfan.Sayed
But I don’t want to match 12,2, or 234432 53. I want to match whether string contains 1 2 OR 1,2 OR 1,2,3 OR 1 2 3 Or any such combinations. And I think this reg. exp. is doing that job. -Original Message- From: Vyacheslav Karamov [mailto:[EMAIL PROTECTED] Sent: Tuesday, October 14, 200

RE: Regarding reg. exp.

2008-10-14 Thread Irfan.Sayed
Thanks really -Original Message- From: Rob Dixon [mailto:[EMAIL PROTECTED] Sent: Tuesday, October 14, 2008 6:31 PM To: Perl Beginners Cc: Sayed, Irfan (Cognizant) Subject: Re: Regarding reg. exp. [EMAIL PROTECTED] wrote: > From: Rob Dixon [mailto:[EMAIL PROTECTED] >> [EMAIL PROTECTED] wr

RE: variable in perl

2008-10-14 Thread Irfan.Sayed
But then what is the difference between $0 and $^X From: Jeff Pang [mailto:[EMAIL PROTECTED] Sent: Tuesday, October 14, 2008 5:28 PM To: Sayed, Irfan (Cognizant); beginners@perl.org Subject: Re:variable in perl > Message du 14/10/08 13:54 > De : [EMAIL PROTECTED] >

RE: Regarding reg. exp.

2008-10-14 Thread Irfan.Sayed
Because I want comma (,) exactly once -Original Message- From: Vyacheslav Karamov [mailto:[EMAIL PROTECTED] Sent: Tuesday, October 14, 2008 4:41 PM To: Sayed, Irfan (Cognizant) Cc: [EMAIL PROTECTED]; beginners@perl.org Subject: Re: Regarding reg. exp. [EMAIL PROTECTED] пишет: > if ($tri

RE: variable in perl

2008-10-14 Thread Irfan.Sayed
thanks From: Jeff Pang [mailto:[EMAIL PROTECTED] Sent: Tuesday, October 14, 2008 5:28 PM To: Sayed, Irfan (Cognizant); beginners@perl.org Subject: Re:variable in perl > Message du 14/10/08 13:54 > De : [EMAIL PROTECTED] > A : beginners@perl.org > Copie à :

RE: Regarding reg. exp.

2008-10-14 Thread Irfan.Sayed
if ($trig_np =~ m/\d,{1}\d|\d\s{1}\d/) this what I did. -Original Message- From: Rob Dixon [mailto:[EMAIL PROTECTED] Sent: Monday, October 13, 2008 6:49 PM To: Perl Beginners Cc: Sayed, Irfan (Cognizant) Subject: Re: Regarding reg. exp. [EMAIL PROTECTED] wrote: > > I have a string and I

sendmail module

2008-10-16 Thread Irfan.Sayed
Hi All, I am using Perl 5.6.1 and want to sue sendmail module. I have copied the Sendmail.pm module to the mail dir. But still it is not executing properly. Following is the exact error. Can't locate MIME/Base64.pm in @INC (@INC contains: /usr/perl5/5.6.1/lib/sun4-solaris-64int /usr/perl5/5

RE: sendmail module

2008-10-16 Thread Irfan.Sayed
Hi All/Jeff, Somehow I am not able to install/configure Sendmail module. Can somebody have another option/script/module then please let me know. I am really stuck. Please help/advise. Regards Irf. -Original Message- From: Jeff Pang [mailto:[EMAIL PROTECTED] Sent: Thursday, October 16,

perl reg. exp. (search and replace)

2008-11-02 Thread Irfan.Sayed
Hi all, I have a string which contains spaces. I need to replace those spaces with underscore, so I have written command like this $string="fsdfsdfsdf fsdfsdfsdf"; chomp($string1 = ($string =~ s/\s+$/_/g)); print "$string1\n"; but still $string1 is not printing proper result. Result sho

help in redirecting output to file

2008-11-20 Thread Irfan.Sayed
Hi All, Can somebody please help me for this block of code. if ("$1" ne "-log"){ `$0 -log "$@" 2>&1 | tee the_log_file.$$.log`; exit 0; } I know this code redirects the output of entire perl script to file but it is not executing as expected. Can somebody please explain / help Re

RE: help in redirecting output to file

2008-11-23 Thread Irfan.Sayed
Thanks but I need STD output and STD error in the same file. How should I do that. Regards Irfan. -Original Message- From: Nitin Kalra [mailto:[EMAIL PROTECTED] Sent: Thursday, November 20, 2008 10:03 PM To: Sayed, Irfan (Cognizant); beginners@perl.org Subject: Re: help in redirecting

SSH to diff. machine

2008-12-02 Thread Irfan.Sayed
Hi All, I need to write perl script which will SSH to different machine , run some commands and then send out the mail with the output of that command. Can it be possible in perl. Please let me know some sample code. Please help/suggest. Regards Irf This e-mail and any files transm

function is executing or not

2008-12-12 Thread Irfan.Sayed
Hi All, I have several subroutines/functions in Perl script. I just wanted to know how to check whether specific function/subroutine in my Perl script is really executing or not. And if it is executing then what is the exit status of that function. Please help/suggest. Regards Irfan.

Help in system function

2008-01-17 Thread Irfan.Sayed
Hi All, I am executing following command in Perl script $vw=system("mk_view $view_name ETC"); if ($vw) { print "view created successfully\n"; } When I run this command, I am getting message "view created successfully". But in reality command is not executing at all Please help

RE: Help in system function

2008-01-17 Thread Irfan.Sayed
Hi, Here is the modified code $vw=system("mk_view $view_name ETC"); print "$vw\n"; if ($vw) { print "view is not created\n"; } else{ print "View is created \n"; Please help Regards Irfan. From: Sayed, Irfan Sent: Thursday, Janua

RE: Help in system function

2008-01-18 Thread Irfan.Sayed
Hello Rob, I just want to find out whether command("mk_view $view_name ETC") is properly running or not. In order to acieve this I have written this code. Please suggest what needs to be done to get the proper output. Please help Regards Irfan. -Original Message- From: Rob Dixon [ma

Hiding standard output

2008-02-01 Thread Irfan.Sayed
Hi All, I want to hide the standard output on the terminal when I am executing the Perl script. For example I am running this command "`/usr/atria/bin/cleartool lslock lbtype:$dep_lbl`; if the execution of this command failed then whatever output is coming on the terminal I want to hide that an

RE: regarding regular expression

2008-02-11 Thread Irfan.Sayed
Thanks John. OOps I did not mentioned one condition while writing the regular expression. condition is : If after last dot(.) there are three digit then don't do anything but if after last dot(.) there are no exactly three digit then replace that dot(.) and all digits after that dot with space.

regarding regular expression

2008-02-11 Thread Irfan.Sayed
Hi All, I have string like this. D.PRS.WEB.02.10.001.1 and my requirement is that I want to remove last dot (.) and all the characters/digit after that dot with the help of regular expression. Please help. Regards Irfan. Project Lead TSINDIA - Production Line Individual Software Solutions -

array question

2008-02-26 Thread Irfan.Sayed
Hello All, I have two arrays contains exact no. of elements. Now what I need to do is , I want to execute certain commands to each elements of the array at a time. It means that I want take first element of first array and first element of second array and then want to execute certain comm

variable help

2008-03-04 Thread Irfan.Sayed
Hi All, How to find out the specific variable contains integer value. In my script ,variable is storing some value but I want to find out whether that value is string or integer. Please help Regards Irfan.

RE: variable help

2008-03-04 Thread Irfan.Sayed
Thanks Brown. It worked. -Original Message- From: Rodrick Brown [mailto:[EMAIL PROTECTED] Sent: Wednesday, March 05, 2008 1:50 AM To: Sayed, Irfan Cc: beginners@perl.org Subject: Re: variable help #!/usr/bin/perl my $p = 10; if( int($p) ) { print "$p is an interger\n"; } ~ On Tue,

RE: variable help

2008-03-04 Thread Irfan.Sayed
Thanks. Can you please explain the reg. expression in more detail. Please --Irfan. Project Lead TSINDIA - Production Line Individual Software Solutions - UMO T-Systems India Private Limited, Pune Telephone: +91-20-30245000/25605000 (Extn: 5271) Mobile: +91 9822 854 227 Fax: ++91-020 25674090