FW: Can anybody explain me what this shebang line is doing?

2010-03-05 Thread sanket vaidya
-Original Message- From: sanket vaidya [mailto:sanket.vai...@patni.com] Sent: Friday, March 05, 2010 5:36 PM To: 'YAPH' Subject: RE: Can anybody explain me what this shebang line is doing? >From: YAPH [mailto:yet.another.perl.hac...@gmail.com] >Sent: Friday, March 0

Question about split

2009-10-23 Thread sanket vaidya
gs; use strict; my $string = '100955 BLow-Gomez,Joseph MMEX.AMER. QHUTC012'; my $id = split(/\s/,$string); print "id = $id"; Output: 4 This is the no. of elements in the array generated by split. Why in first case (when brackets are used) it prints correct

RE: Substitution question

2009-06-30 Thread sanket vaidya
Thanks John. It works Regards, Sanket Vaidya -Original Message- From: John W. Krahn [mailto:jwkr...@shaw.ca] Sent: Wednesday, July 01, 2009 11:17 AM To: Perl Beginners Subject: Re: Substitution question sanket vaidya wrote: > Hi all, Hello, > As a part of one program I need

Substitution question

2009-06-30 Thread sanket vaidya
anyone tell me why this happens & how to overcome it? Thanks & Regards, Sanket Vaidya _ This e-mail message may contain proprietary, confidential or legally privileged information for the sole use of the perso

RE: Query related to PAR::Packer

2009-06-23 Thread sanket vaidya
This depends on your source package. Refer 'Cross-platform Packages' from above link. Hope this helps. Thanks & Regards, Sanket Vaidya _ This e-mail message may contain proprietary, confidential or legally privile

RE: Range Operator Question

2009-05-29 Thread sanket vaidya
-Original Message- From: Chas. Owens [mailto:chas.ow...@gmail.com] Sent: Friday, May 29, 2009 10:22 AM To: sanket vaidya Cc: beginners@perl.org Subject: Re: Range Operator Question On Thu, May 28, 2009 at 23:49, sanket vaidya wrote: snip > Can anyone write few simple codes explain

List of perl functions that work on LINUX & not in Windows

2009-05-28 Thread sanket vaidya
l on Windows. Thanks & Regards, Sanket Vaidya _ 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 a

RE: Range Operator Question

2009-05-28 Thread sanket vaidya
-Original Message- From: sanket vaidya [mailto:sanket.vai...@patni.com] Sent: Friday, May 29, 2009 9:20 AM To: 'beginners@perl.org' Subject: RE: Range Operator Question -Original Message- From: Chas. Owens [mailto:chas.ow...@gmail.com] Sent: Thursday, May 28, 2009

RE: Range Operator Question

2009-05-28 Thread sanket vaidya
-Original Message- From: Chas. Owens [mailto:chas.ow...@gmail.com] Sent: Thursday, May 28, 2009 5:55 PM To: sanket vaidya Cc: beginners@perl.org Subject: Re: Range Operator Question On Thu, May 28, 2009 at 07:51, sanket vaidya wrote: > Hi, > > I came across this statement abo

Range Operator Question

2009-05-28 Thread sanket vaidya
Hi, I came across this statement about 'range' operators somewhere. There is very little difference between $x..$y and $x...$y, and if the second operand is a constant then they are identical. What is the difference? Kindly explain with example. Thanks & Regards,

RE: Kindly explain special variable $|

2009-05-28 Thread sanket vaidya
>>-Original Message- > From: Thomas Bätzler [mailto:t.baetz...@bringe.com] > Sent: Thursday, May 28, 2009 11:57 AM > To: beginners@perl.org > Cc: sanket vaidya >Subject: AW: Kindly explain special variable $| > sanket vaidya asked: > It would be great if some

Kindly explain special variable $|

2009-05-27 Thread sanket vaidya
the difference. Thanks & Regards, Sanket Vaidya _ 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 origina

RE: Question about split

2009-05-27 Thread sanket vaidya
-Original Message- From: Chas. Owens [mailto:chas.ow...@gmail.com] Sent: Wednesday, May 27, 2009 4:52 PM To: sanket vaidya Cc: beginners@perl.org Subject: Re: Question about split On Wed, May 27, 2009 at 06:45, sanket vaidya wrote: > Hi all, > > Kindly look at the code below

Question about split

2009-05-27 Thread sanket vaidya
64 Why the first element of @numbers is 'blank'? Kindly explain with example. Thanks & Regards, Sanket Vaidya _ This e-mail message may contain proprietary, confidential or legally privileged information

RE: How to append to existing excel sheet?

2009-05-27 Thread sanket vaidya
3rd row upto 100th column $row = 3; for $col (1..100) { $worksheet->write($row, $col, $data); } #$data will be specific for each cell Regards, Sanket Vaidya _ This e-mail message may contain proprietary, confidential o

RE: How to append to existing excel sheet?

2009-05-27 Thread sanket vaidya
) { $worksheet->write($row, $col, $data); } #$data will be specific for each cell Regards, Sanket Vaidya _ This e-mail message may contain proprietary, confidential or legally privileged information for the sole use of the pe

RE: Difference between for & foreach loop

2009-05-25 Thread sanket vaidya
-Original Message- From: Randal L. Schwartz [mailto:mer...@stonehenge.com] Sent: Monday, May 25, 2009 10:10 PM To: beginners@perl.org Subject: Re: Difference between for & foreach loop >>>>> ""sanket" == "sanket vaidya" writes: &quo

readdir() question

2009-05-25 Thread sanket vaidya
'If you're planning to filetest the return values out of a readdir <http://perldoc.perl.org/functions/readdir.html> , you'd better prepend the directory in question. Otherwise, because we didn't chdir <http://perldoc.perl.org/functions/chdir.html&g

Difference between for & foreach loop

2009-05-24 Thread sanket vaidya
Hi all, What is the difference between the 'for' & 'foreach' loops? I know that they can be used interchangeably then what is the purpose of keeping them separate? Can anyone suggest me a good url which can tell the difference between two? Thanks &

RE: xml parsing

2009-04-29 Thread sanket vaidya
Hi, Search for some XML modules on CPAN & get your job done by using appropriate module. I haven't used perl with XML So cannot tell you the exactly which module. Thanks, Sanket Vaidya -Original Message- From: Sharan Basappa [mailto:sharan.basa...@gmail.com] Sent: Wednesday,

Re: How to install Win32 module...

2009-03-02 Thread sanket
On Feb 25, 2:41 pm, spitt...@jhmi.edu (Steve Pittman) wrote: > I downloaded and unzipped the TAR file...how do I install it...directions say > copy into lib which didn't work > > thanks in advance Hi, Download C++ compiler & (nmake or dmake). Extract tar files. navigate to the directory. perl

RE: Question related Join function

2009-01-29 Thread sanket vaidya
Pl. see my soln in the original mail -Original Message- From: sanket vaidya [mailto:sanket.vai...@patni.com] Sent: Thursday, January 29, 2009 3:35 PM To: 'Anirban Adhikary' Cc: 'beginners@perl.org' Subject: RE: Question related Join function Hi Anirban, Join

RE: Question related Join function

2009-01-29 Thread sanket vaidya
Hi Anirban, Join works this way only. However u can accomplish your task as follows: -Original Message- From: Anirban Adhikary [mailto:anirban.adhik...@gmail.com] Sent: Thursday, January 29, 2009 3:08 PM To: beginners@perl.org Subject: Question related Join function Dear List >>I ha

RE: Is there a way to un-install modules?

2009-01-28 Thread sanket vaidya
You can do the same with file equivalent to '.packlist' on 'LINUX' or 'UNIX'. Hope this helps. Thanks Sanket Vaidya -Original Message- From: Randal L. Schwartz [mailto:mer...@stonehenge.com] Sent: Sunday, January 25, 2009 9:56 AM To: beginners@perl.org

RE: How to know no. of times the script has been executed?

2009-01-08 Thread sanket vaidya
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

How to check whether user types exit in cmd?

2009-01-08 Thread sanket vaidya
'x') { do something } How to do that? Thanks & Regards, Sanket Vaidya http://www.patni.com World-Wide Partnerships. World-Class Solutions. _ This e-mail message may contain proprietary, confidential or legal

How to know no. of times the script has been executed?

2009-01-07 Thread sanket vaidya
that? Thanks & Regards, Sanket Vaidya 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 o

RE: about "print"

2008-12-29 Thread sanket vaidya
oth cases. Similarly $"="a" will print v1av2av3. Thanks Sanket Vaidya -Original Message- From: xie ningde [mailto:n.d.ningde...@gmail.com] Sent: Tuesday, December 30, 2008 10:20 AM To: beginners@perl.org Subject: about "print" I'm a new perl user. I was

RE: Is there some IDE dedicated to perl?

2008-12-29 Thread sanket vaidya
ad Perl Interpreter & use some editor. For Windows few editors are Crimson, Context, Perl Express etc. I use Perl Express. Thanks Sanket Vaidya http://www.patni.com World-Wide Partnerships. World-Class Solutions. _ This e-mail me

RE: How to read email from Inbox

2008-12-23 Thread sanket vaidya
-Original Message- From: yonghua.p...@gmail.com [mailto:yonghua.p...@gmail.com] On Behalf Of Jeff Peng Sent: Tuesday, December 23, 2008 5:30 PM To: sanket vaidya Cc: beginners@perl.org Subject: Re: How to read email from Inbox 2008/12/23 sanket vaidya : > > > Hi all, > >

How to read email from Inbox

2008-12-23 Thread sanket vaidya
Hi all, How can we read mail from inbox without using mail client like outlook? Using perl. i.e. Is it possible to read Inbox of your gmail account using perl? Thanks & Regards, Sanket Vaidya http://www.patni.com World-Wide Partnerships. World-Class Solut

Uninitialized value in array

2008-11-24 Thread sanket vaidya
itten as my ($bi, $bn, @bchrs); my $boundry = ""; foreach $bn (48..57,65..90,97..122) { $bchrs[$bi++] = chr($bn); } print @bchrs; Output: 0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz Why value is uninitialized in Case 1. Thanks &a

problem installing Mail::Transport::Dbx

2008-11-05 Thread sanket vaidya
2-X86-multi-threat-5.10). Any suggestions how to proceed with installation. Thanks & Regards, Sanket Vaidya http://www.patni.com World-Wide Partnerships. World-Class Solutions. _ This e-mail message may contain proprieta

RE: problem using mime::lite

2008-10-27 Thread sanket vaidya
Hi all, The problem was with the text file. I have solved it. Now pl. don't work for this mail. Thanks Sanket Vaidya _ Hi all, I want to send mail using mime::lite to email addresses in text file (say list.txt). Say the ids are [EMAIL PROTECTED], [EMAIL PROTECTED] &a

problem using mime::lite

2008-10-27 Thread sanket vaidya
problem is this code sys that id [EMAIL PROTECTED] doesn't exists. If I try @array = ('[EMAIL PROTECTED]','[EMAIL PROTECTED]') it works. The error is SMTP recipient command failed. I have gone thr

RE: if condition question

2008-10-16 Thread sanket vaidya
-Original Message- From: Chas. Owens [mailto:[EMAIL PROTECTED] Sent: Thursday, October 16, 2008 2:36 PM To: sanket vaidya Cc: beginners@perl.org Subject: Re: if condition question On Thu, Oct 16, 2008 at 04:54, sanket vaidya <[EMAIL PROTECTED]> wrote: snip > Now when I write

if condition question

2008-10-16 Thread sanket vaidya
use warnings; use strict; my $string = "test"; $string eq "test" ? print "correct" : ""; Output: Correct Useless use of constant in void context at line 5. Can any one suggest the reason of warning in Case2. Thanks & Regards, San

if condition question

2008-09-29 Thread sanket vaidya
use warnings; use strict; my $string = "test"; $string eq "test" ? print "correct" : ""; Output: Correct Useless use of constant in void context at line 5. Can any one suggest the reason of warning in Case2. Thanks & Regards, San

RE: pattern matching question

2008-09-23 Thread sanket vaidya
ie "Cannot open file: $!"; #(example.txt is file containing your column) undef $/; my $text = ; $text=~s/[^AGTC]//g; #remove anything which is not A,G,T or C print "$text"; # $text will contain your required output Let me know if this helps. Thanks Sanket Vaidya -Original Mess

RE: pattern matching question

2008-09-23 Thread sanket vaidya
ie "Cannot open file: $!"; #(example.txt is file containing your column) undef $/; my $text = ; $text=~s/[^AGTC]//g; #remove anything which is not A,G,T or C print "$text"; # $text will contain your required output Let me know if this helps. Thanks Sanket Vaidya -Original Message

Perl installation on LINUX

2008-09-03 Thread sanket vaidya
. stop Note:- I am navigated to UU directory after Configure. I am using KNOPPIX & I need to install it in the above path only. Any suggestions from you all, How to proceed further? I use KNOPPIX Live CD & want to install modules, so cannot install it in perl that comes with it. T

Perl installation on LINUX?

2008-09-03 Thread sanket
Hi all, I have downloaded perl 5.10. I install it using following steps: sh Configure -de -Dprefix=/mnt/hdc8/Perl make make test make install when I run 'make' after configure, I get following message. No rule to make target 'test'. stop Note:- I am navigated to

RE: How to compress an exe file?

2008-08-25 Thread sanket vaidya
Hi Raymond, Thanx a lot for suggestion. -Original Message- From: Raymond Wan [mailto:[EMAIL PROTECTED] Sent: Monday, August 25, 2008 11:21 AM To: sanket vaidya Cc: beginners@perl.org Subject: Re: How to compress an exe file? Hi Sanket, sanket vaidya wrote: > I have m

How to compress an exe file?

2008-08-24 Thread sanket vaidya
Hi all, I have made an exe using PAR::Packer. Now I want to reduce the size of exe. Can anyone suggest me how to do that? Thanks & Regards, Sanket Vaidya http://www.patni.com World-Wide Partnerships. World-Class Solut

Parl-Packer installation urgent help required

2008-08-20 Thread sanket vaidya
file urgently. Pl. suggest how to get rid of this. I use Active Perl 5.10.0 on Win Xp. Thanks & Regards, Sanket Vaidya http://www.patni.com World-Wide Partnerships. World-Class Solutions. _ This e-mail message may

Problem related to ZGV installation

2008-07-28 Thread sanket vaidya
Hi all, I have posted this in couple of LINUX groups before 5 days & yet have not got any reply. Can anyone from this group could help me out? I am a beginner & I haven't installed anything on LINUX. I use KNOPPIX 3.7 Live CD. I have downloaded the ZGV to view images in Text-only mod

RE: Extract the desired value from a regex

2008-07-17 Thread sanket vaidya
s" Output: time = 8:00AM - 10:20 days = M,W -Original Message- From: Manasi Bopardikar [mailto:[EMAIL PROTECTED] Sent: Friday, July 18, 2008 10:06 AM To: 'sanket vaidya' Subject: RE: Extract the desired value from a regex String is M W 8:00AM - 10:20 I want to put M,W in days

RE: Extract the desired value from a regex

2008-07-17 Thread sanket vaidya
o capture & what to capture? Thanks & Regards, Sanket Vaidya Patni Computer Systems Limited -Original Message- From: Manasi Bopardikar [mailto:[EMAIL PROTECTED] Sent: Friday, July 18, 2008 9:52 AM To: 'sanket vaidya' Subject: RE: Extract the desired value from a regex Ca

RE: Extract the desired value from a regex

2008-07-17 Thread sanket vaidya
$1 does not work because you are using metacharacter "?" in regex. Use \Q & \E to capture. Thanks & Regards, Sanket Vaidya Patni Computer Systems Limited A 78/9, GIDC, Electronics Estate Sector - 25, Gandhinagar - 382 016 Gujarat, India Tel: 91-79-23240905 Ext: 243 ---

RE: How can we Install Perl in Windows

2008-07-17 Thread sanket vaidya
AIL PROTECTED] Sent: Thursday, July 17, 2008 2:42 PM To: sanket vaidya Cc: 'Perl' Subject: Re: How can we Install Perl in Windows sanket vaidya wrote: > Yes it is a free download > > I have downloaded the Active Perl from http://downloads.activestate.com/ActivePerl/Windows/5.

RE: How can we Install Perl in Windows

2008-07-17 Thread sanket vaidya
Yes it is a free download -Original Message- From: Sivasakthi [mailto:[EMAIL PROTECTED] Sent: Thursday, July 17, 2008 2:14 PM To: sanket vaidya Cc: 'Perl' Subject: Re: How can we Install Perl in Windows sanket vaidya wrote: > Download Latest version of ActivePerl for

RE: How can we Install Perl in Windows

2008-07-17 Thread sanket vaidya
Download Latest version of ActivePerl for windows from http://www.activestate.com. Unzip the file. Click on installer.bat & Follow the instructions. You require Apache or IIS only for CGI scripting. You can run other programs without that. -Original Message- From: Sivasakthi [mailto:[

Regex help?

2008-05-07 Thread sanket vaidya
HI all, Kindly go through the code below. use warnings; use strict; my $i=1; while($i<=10) { $_ = "abcpqr"; $_=~ s/(?=pqr)/$i/; print "$_\n"; $i++; } Output: abc1pqr abc2pqr abc3pqr abc4pqr abc5pqr abc6pqr abc7pqr abc8pqr abc9pqr abc10pqr The expected output is

Installing DBD::mysql??

2008-04-17 Thread sanket vaidya
Hi, I cannot instead module using ppm or MCPAN (office proxy wont allow me to do this) & I have never installed a perl module manually. I am installing DBD::mysql module. When I get into the module directory & type "perl makefile.pl" I get error as below: Failed to determine directory of my

Re: CGI serverpush??

2008-04-17 Thread sanket
On Apr 16, 6:28 pm, [EMAIL PROTECTED] (Gunnar Hjalmarsson) wrote: > sanket vaidya wrote: > > Kindly go through the code below. > > > > > use CGI::Push qw(:standard); > > > do_push(-next_page=>\&refresh, > > -last_page=>\&done); >

CGI serverpush??

2008-04-15 Thread sanket vaidya
Hi, Kindly go through the code below. #!D:\Perl\bin\perl use warnings; use strict; my $line=""; use CGI::Push qw(:standard); do_push(-next_page=>\&refresh, -last_page=>\&done); sub refresh() { my ($cgi,$count)[EMAIL PROTECTED]; if($count>10) { return undef;

RE: grabbing text between two tokens

2008-04-15 Thread sanket vaidya
Hi, Here is the code to accomplish your task. It involves too many substitutions but it accomplishes your task. I think there should be a simpler substitution which I am not aware: use warnings; use strict; my $str = "tokena name: name1 tokenb tokena name: name2 tokenb tokena name: name3

behavior regex code to count no. of alphabets in a scalar variable?

2008-04-13 Thread sanket vaidya
Go through the below codes. use strict; use warnings; my $scalar = "aaaba" =~ /a/g; my @list = "aaaba" =~ /a/g; my $list_then_scalar =()= "aaaba" =~ /a/g; print "scalar: $scalar\nlist: @list\nlist then scalar: $list_then_scalar\n"; $scalar="aaaba"; my $count = $scalar =~ tr/a//; print "\n\nCou

RE: how to extract the last digit

2008-04-02 Thread sanket vaidya
Hi You get the error on chop because anything given with chop function is considered as string (In other words chop acts on string). So perl considers the '+' operator you provide with chop as string rather than addition operator.This is how your task can be accomplished. use warnings; use stric

RE: how to write 0 to 10 in reg exp.

2008-04-02 Thread sanket vaidya
Here is the code to match 0 to 10 using regex. use warnings; use strict; print "Enter any number:"; my $input = ; chomp($input); if($input=~ m/^10$|^[0-9]$/) { print "matched"; } else { print "not matched"; } Hope it helps. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL P

RE: Load hash from a scalar

2008-03-30 Thread sanket vaidya
Here is the code to accomplish your task. use warnings; use strict; my $a = "a, 1, b, 2, c, 3"; $a =~ s/ //g; #delete spaces from $a my @array = split(",",$a); my %b = ( $array[0] => $array[1], $array[2] => $array[3], $array[4] => $array[5] ); for (keys%b) { print "$_ => $b{$_}\n"; } The

Using File::Find module???

2008-03-27 Thread sanket vaidya
Hi all I have some files stored in directory "resumes1" (say the files are file1, file2 & file3). When I run the following code use warnings; use strict; use File::Find; find (\&del,"D:/resumes1"); sub del { print "File name is $_\n "; } The output is: File n

RE: How to replace one line in a text file with Perl?

2008-03-27 Thread sanket vaidya
Here is the entire code to accomplish your task. It will delete 1st & 3rd lines. use warnings; use strict; my @array; open FH,"data.txt"; @array = ; for my $i (0..$#array) { $array[$i] =~ s/^(\*\/tmp\/dst\/file(1|3)\*(\d){3}\*RW\*(\d){3,4})$/ /; #replace the lines you want to delete with " "

RE: How to replace one line in a text file with Perl?

2008-03-27 Thread sanket vaidya
Here is the entire code to accomplish your task. It will delete 1st & 3rd lines. use warnings; use strict; my @array; open FH,"data.txt"; @array = ; for my $i (0..$#array) { $array[$i] =~ s/^(\*\/tmp\/dst\/file(1|3)\*(\d){3}\*RW\*(\d){3,4})$/ /; #replace the lines you want to delete with " " (sp

reference to subroutine???

2008-03-26 Thread sanket vaidya
ent outputs in two different versions? >From where did "1" come from & how to remove it? Thanks in advance. Regards, Sanket Vaidya Software Engineer Patni Computer Systems Ltd. A-78/9, GIDC Electronics Estate, Sector 25, Gandhinagar - 382016 Tel: +91-79-2324 0905 Ext: 334 Mobile: +91-9824300897

Package???

2008-03-20 Thread sanket vaidya
Hi all, I am having some questions regarding following codes: use warnings; $name = "sanket"; $fred::name = "Fred; print "In main name = $name\n"; package Fred; print "Now name = $name"; The output will be as expected: In main name = sanket Now name = Fre

Package??

2008-03-20 Thread sanket
Hi all, I am having some questions regarding following codes: use warnings; $name = "sanket"; $fred::name = "Fred; print "In main name = $name\n"; package Fred; print "Now name = $name"; The output will be as expected: In main name = sanket Now name = Fre