Re: Learning Perl

2007-10-10 Thread Jeff Pang
9 Oct 2007 17:59:42 -0700, [EMAIL PROTECTED] <[EMAIL PROTECTED]>: > Another book that I've been using recently is Perl by Example 3rd > Edition Perl by Example? do you mean the "perl cookbook"?. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http

Re: Need advise on sending .eml attachment

2007-10-10 Thread Panda-X
> > > server, I can't take control to the mail server or touch the folders. > > > You don't need to touch the folders, nor would you want to, I was just > referring to leaving the processed e-mail untouched so it could be > resent directly. The only thing to watch for if you're using a remote > ma

Re: basic regex question

2007-10-10 Thread Panda-X
2007/10/11, Jim <[EMAIL PROTECTED]>: > > Hi Everyone, > > I am trying to match file & subdir names from a back tic generated list. > I never find anything and there are files in the directory with a correct > name. > but if i make up a list to use as filenames > it works as i expect ... any insight

basic regex question

2007-10-10 Thread Jim
Hi Everyone, I am trying to match file & subdir names from a back tic generated list. I never find anything and there are files in the directory with a correct name. but if i make up a list to use as filenames it works as i expect ... any insight greatly appreciated thanks Jim #!/usr/bin/perl

Re: Need advise on sending .eml attachment

2007-10-10 Thread Matthew Whipple
Panda-X wrote: > Hi Matthew, > > Thanks for you help ! =) > > 2007/10/10, Matthew Whipple <[EMAIL PROTECTED]>: > > > > Yes, that's a one mail file, and it's actually the source code for an email, > plain text. Not the mail box. > There's actually little difference between a piece of mail and

Re: Need advise on sending .eml attachment

2007-10-10 Thread Panda-X
Hi Matthew, Thanks for you help ! =) 2007/10/10, Matthew Whipple <[EMAIL PROTECTED]>: > > I'm not sure what exactly qualifies as an ".eml" file, and a quick look > appears as though it's somewhat an MS Outlook format and therefore it's > questionable whether the data is being modified or not (my

Re: Need advise on sending .eml attachment

2007-10-10 Thread Panda-X
Hi Jenda... Are you the author of Mail::Sender ?? I like it very much, that's very handy, as well as Config::IniHash. Thanks for give me a reply, and I hope my problem can be fixed in the Mail::Sender way. 2007/10/11, Jenda Krynicky <[EMAIL PROTECTED]>: > > From: Panda-X <[EMAIL PROTECTED]> > > M

Re: How to update value of global variable from child process (fork)

2007-10-10 Thread Jeff Pang
2007/10/10, dinesh <[EMAIL PROTECTED]>: > > Issue here is: The global associative array is not getting updated in > the child process. Please suggest me how to do this. childs and parent are separte,things changed on each process can't affect another. Say you have @global in parent,after forking,

Re: Perl Scalars

2007-10-10 Thread yitzle
On 10/10/07, Jenda Krynicky <[EMAIL PROTECTED]> wrote: > > And BTW ... you are aware of the fact that if you do > > int *b; > *b = 5; > > you cause the program to crash, right? > You did not start by assigning a variable to a reference to > something, you assigned to the thing already referenced by

Re: Perl Scalars

2007-10-10 Thread yitzle
On 10/10/07, Jenda Krynicky <[EMAIL PROTECTED]> wrote: > > From: yitzle <[EMAIL PROTECTED]> > > On 10/10/07, Jenda Krynicky <[EMAIL PROTECTED]> wrote: > > > > Anyhow, the point is that Perl doesn't have those confusing weird > > > "pointer" > > > > stuff. $a and $c do not "point" to the same plac

Re: Beginner Reg.Expression Question

2007-10-10 Thread Matthew Whipple
This wouldn't scale past double digits. If you're going to separate it out you may as well break the minor revisions into it's own variable and then concatenate/format on output...that would also be more easily used with a code management system's built in revision tracking (though this could also

Re: Need advise on sending .eml attachment

2007-10-10 Thread Jenda Krynicky
From: Panda-X <[EMAIL PROTECTED]> > quite new to be here. I just wondering if Perl have some quite suitable > module to do this. > > I have wrote a spam filter for my office, which use Net::POP3 to get mails > and delete() mails that don't want, the 'got()' mails is however saved at > the other pl

Re: Perl Scalars

2007-10-10 Thread Jenda Krynicky
From: yitzle <[EMAIL PROTECTED]> > On 10/10/07, Jenda Krynicky <[EMAIL PROTECTED]> wrote: > > > Anyhow, the point is that Perl doesn't have those confusing weird > > "pointer" > > > stuff. $a and $c do not "point" to the same place, the just got the same > > > value. (Well, Perl /does/ have point

Re: Beginner Reg.Expression Question

2007-10-10 Thread Dr.Ruud
"Tatiana Lloret Iglesias" schreef: > What regular expression do I need to convert Version: 1.2.3 to > Version: > 1.2.4 ? > > I.e. my pattern is Version: number.number.number and from that i need > Version: number.number.number+1 > After the : i can have a space or not... Why use a regex? pe

Re: how to remove ^M character from every line

2007-10-10 Thread luyan . bj
On Sep 3, 9:03 am, [EMAIL PROTECTED] (Beginner) wrote: > On 3 Sep 2007 at 13:38, Andrew Curry wrote: > > > The problem is its unclear, its always better to be clear in code. It will > > also remove any formatting from the end of lines. If you wanted to be just > > as crude you can use chomp. > > I

Re: How to update value of global variable from child process (fork)

2007-10-10 Thread John W. Krahn
dinesh wrote: Hi, Hello, Subject: How to update value of global variable from child process (fork) The child and parent are separate processes so you have to use some type of InterProcess Communication to update values between them. perldoc perlipc John -- Perl isn't a toolbox, but a s

Re: Tony or Anthony

2007-10-10 Thread Dr.Ruud
"Jeff Pang" schreef: > Dr.Ruud: >> No need for (), so you can write: >> >> m/tony|anthony/i > > or, > /tony/i || /anthony/i > > this is faster than /tony|anthony/i. Faster for what? For one, it takes longer to type. With which version of Perl, and with which exact test data set did you do your

Re: Beginner Reg.Expression Question

2007-10-10 Thread dinesh
On Oct 10, 2:39 pm, [EMAIL PROTECTED] (Tatiana Lloret Iglesias) wrote: > Hi all! > > What regular expression do I need to convert Version: 1.2.3 to Version: > 1.2.4 ? > > I.e. my pattern is Version: number.number.number and from that i need > Version: number.number.number+1 > After the : i can

How to update value of global variable from child process (fork)

2007-10-10 Thread dinesh
Hi, We need to run test in multiple test cycles and in each test cycle multiple operations need to be performed. Currently one test cycle is taking 10 seconds and we need to reduce the time to 4 seconds. I have used fork() to do this as follows (only one operation is given here). I will update the

Re: Bubble sort...

2007-10-10 Thread Matthew Whipple
Work inside out. If the inner loop is working properly, then there should be some difference after the initial pass and you won't be left with nothing or infinity (unless that's the trouble loop, but the proper inner loop is easy enough to see..). [EMAIL PROTECTED] wrote: > I'm having problems tr

Re: Need advise on sending .eml attachment

2007-10-10 Thread Matthew Whipple
I'm not sure what exactly qualifies as an ".eml" file, and a quick look appears as though it's somewhat an MS Outlook format and therefore it's questionable whether the data is being modified or not (my strongest association is the Outlook RTF issues several years back). I'm thinking that regardle

Re: Bubble sort...

2007-10-10 Thread Rob Dixon
[EMAIL PROTECTED] wrote: I'm having problems trying to figure out 'bubble sort'. I'm working on assignment for a class and I have to do the following: Use the following code as a starting point for the next lab. #!/usr/bin/perl @array = (5,3,2,1,4); ## include your code here ## foreach $ele

Re: Bubble sort...

2007-10-10 Thread Tom Phoenix
On 10/9/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > I'm having problems trying to figure out 'bubble sort'. I'm working on > assignment for a class Well, that *is* the only valid reason to code bubble sort in Perl, I must admit. I hope you're in a class about sorting algorithms, because th

Re: Tony or Anthony

2007-10-10 Thread newBee
On Oct 9, 8:18 pm, [EMAIL PROTECTED] (Jeff Pang) wrote: > 2007/10/10, Dr.Ruud <[EMAIL PROTECTED]>: > > > No need for (), so you can write: > > > m/tony|anthony/i > > or, > /tony/i || /anthony/i > > this is faster than /tony|anthony/i. Thanks to all you guys... after I published the question I di

Bubble sort...

2007-10-10 Thread [EMAIL PROTECTED]
I'm having problems trying to figure out 'bubble sort'. I'm working on assignment for a class and I have to do the following: Use the following code as a starting point for the next lab. #!/usr/bin/perl @array = (5,3,2,1,4); ## include your code here ## foreach $elem (@array){ print "$elem";

Re: Learning Perl

2007-10-10 Thread [EMAIL PROTECTED]
On Oct 9, 11:37 am, [EMAIL PROTECTED] (Francisco Valladolid) wrote: > Hi. > > On 10/9/07, Paul Lalli <[EMAIL PROTECTED]> wrote: > > > > > > > On Oct 9, 9:17 am, [EMAIL PROTECTED] (Bob McConnell) wrote: > > > My experience was that "Learning Perl" was the introduction that > > > prepared me to tackl

Need advise on sending .eml attachment

2007-10-10 Thread Panda-X
Hi list, quite new to be here. I just wondering if Perl have some quite suitable module to do this. I have wrote a spam filter for my office, which use Net::POP3 to get mails and delete() mails that don't want, the 'got()' mails is however saved at the other place, for 2 reasons, further study on

Re: What don't I understand about hash assigments?

2007-10-10 Thread Paul Lalli
On Oct 10, 11:57 am, [EMAIL PROTECTED] (Kevin Zembower) wrote: > I've got a file that looks like this (using cat -vet to show tabs as > ^I): > > [EMAIL PROTECTED]: $ cat -vet /tmp/PeopleFinderDepartments.txt > 1^IH.07$ > 2^IH.22$ > 3^IH.30$ > 4^IH.32$ > 5^IH.32.01$ > 6^IH.32.05$ > 7^IH.32.06$ > [EM

Re: Perl Scalars

2007-10-10 Thread yitzle
On 10/10/07, Jenda Krynicky <[EMAIL PROTECTED]> wrote: > > From: yitzle <[EMAIL PROTECTED]> > > On 10/10/07, Kaushal Shriyan <[EMAIL PROTECTED]> wrote: > > > > > > Can you please explain me with a sample code. If I understand it > correctly > > > does the below code holds true for your explanation

What don't I understand about hash assigments?

2007-10-10 Thread Zembower, Kevin
I've got a file that looks like this (using cat -vet to show tabs as ^I): [EMAIL PROTECTED]: $ cat -vet /tmp/PeopleFinderDepartments.txt 1^IH.07$ 2^IH.22$ 3^IH.30$ 4^IH.32$ 5^IH.32.01$ 6^IH.32.05$ 7^IH.32.06$ [EMAIL PROTECTED]: $ I want to write a script that will use these values to replace the

Re: Perl Scalars

2007-10-10 Thread Matthew Whipple
It may be easier to understand outside of computer context and delving into pointers/references/memory addresses. I'm sure there are some good tried and true analogies that I can't think of so I'll try to come of up with one that fits well into computers without getting too far from reality or too

Re: Perl Scalars

2007-10-10 Thread Jenda Krynicky
From: yitzle <[EMAIL PROTECTED]> > On 10/10/07, Kaushal Shriyan <[EMAIL PROTECTED]> wrote: > > > > Can you please explain me with a sample code. If I understand it correctly > > does the below code holds true for your explanation > > Lets put it this way. > I the world of C/C++, there's something

Re: Perl Scalars

2007-10-10 Thread Jenda Krynicky
From: Rob Dixon <[EMAIL PROTECTED]> > Kaushal Shriyan wrote: > > Hi, > > > > I am referring to http://www.gnulamp.com/perlscalars.html > > > > $a = $b; # Assign $b to $a > > > > Note that when Perl assigns a value with *$a = $b* it makes a copy of $b and > > then assigns that to $a. Therefore th

Re: Calling DLL functions from perl script

2007-10-10 Thread Jenda Krynicky
From: Pavel Vodopyan <[EMAIL PROTECTED]> > Hello Friends! > Does anybody know how to call DLL functions from Perl script. > (On Windows OS). > I will be thankful for any ideas. > Thank you. Are these "good old windows DLLs" or .Net ones? In the first case have a look at Win32::API : http://sea

Re: Perl Scalars

2007-10-10 Thread yitzle
On 10/10/07, Kaushal Shriyan <[EMAIL PROTECTED]> wrote: > > Can you please explain me with a sample code. If I understand it correctly > does the below code holds true for your explanation > Lets put it this way. I the world of C/C++, there's something called a pointer. The syntax of Perl and C/

Re: Calling DLL functions from perl script

2007-10-10 Thread Chas. Owens
On 10/10/07, Pavel Vodopyan <[EMAIL PROTECTED]> wrote: > Hello Friends! > Does anybody know how to call DLL functions from Perl script. > (On Windows OS). > I will be thankful for any ideas. > Thank you. snip This depends heavily on the DLL you are talking about. Most (if not all) of the Win32 in

Re: Calling DLL functions from perl script

2007-10-10 Thread Pavel Vodopyan
Hello Rob, I've tried to use it but cannot find there types which are presented in interface for my DLL, for example: LONGLONG iss_create (LONGLONG llDevline, LONGLONG llVersion, CString strIssueFields, CString strActivityAssignment, CString strComment) Rob Dixon wrote: Pavel Vodopyan w

Re: Calling DLL functions from perl script

2007-10-10 Thread Laxminarayan G Kamath A
On Wed, 10 Oct 2007 15:21:09 +0300, Pavel Vodopyan <[EMAIL PROTECTED]> wrote: > Hello Friends! > Does anybody know how to call DLL functions from Perl script. > (On Windows OS). > I will be thankful for any ideas. > Thank you. > I actually have absolutely no idea.. but i think i just did the rig

Re: Calling DLL functions from perl script

2007-10-10 Thread Rob Dixon
Pavel Vodopyan wrote: Does anybody know how to call DLL functions from Perl script. (On Windows OS). I will be thankful for any ideas. It depends what DLL functions you want to call, but take a look at Win32::API, which may do what you want. Rob -- To unsubscribe, e-mail: [EMAIL PROTECTED] F

Re: Perl Scalars

2007-10-10 Thread Rob Dixon
Kaushal Shriyan wrote: Thanks Rob All they're saying is that $a = $b doesn't tie $a and $b together in any way, it just copies the value of $b to $a. If you change $b after that it won't alter $a again. Can you please explain me with a sample code. If I understand it correctly does the bel

Re: Perl Scalars

2007-10-10 Thread Kaushal Shriyan
On 10/10/07, Rob Dixon <[EMAIL PROTECTED]> wrote: > > Kaushal Shriyan wrote: > > Hi, > > > > I am referring to http://www.gnulamp.com/perlscalars.html > > > > $a = $b; # Assign $b to $a > > > > Note that when Perl assigns a value with *$a = $b* it makes a copy of $b > and > > then assigns that to $

Calling DLL functions from perl script

2007-10-10 Thread Pavel Vodopyan
Hello Friends! Does anybody know how to call DLL functions from Perl script. (On Windows OS). I will be thankful for any ideas. Thank you. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/

Re: Perl Scalars

2007-10-10 Thread Rob Dixon
Kaushal Shriyan wrote: Hi, I am referring to http://www.gnulamp.com/perlscalars.html $a = $b; # Assign $b to $a Note that when Perl assigns a value with *$a = $b* it makes a copy of $b and then assigns that to $a. Therefore the next time you change $b it will not alter $a. I did not understan

Perl Scalars

2007-10-10 Thread Kaushal Shriyan
Hi, I am referring to http://www.gnulamp.com/perlscalars.html $a = $b; # Assign $b to $a Note that when Perl assigns a value with *$a = $b* it makes a copy of $b and then assigns that to $a. Therefore the next time you change $b it will not alter $a. I did not understand the Note:- Can some one

Re: Beginner Reg.Expression Question

2007-10-10 Thread Tatiana Lloret Iglesias
Thanks a lot !! T On 10/10/07, Rob Dixon <[EMAIL PROTECTED]> wrote: > > Tatiana Lloret Iglesias wrote: > > > > Hi all! > > > > What regular expression do I need to convert Version: 1.2.3 to > Version: > > 1.2.4 ? > > > > I.e. my pattern is Version: number.number.number and from that i need

Re: Beginner Reg.Expression Question

2007-10-10 Thread Jeff Pang
$ perl -e '$x="Version: 1.2.3";$x=~s/(Version: \d+\.\d+\.)(\d+)/$1.($2+1)/e;print $x' Version: 1.2.4 2007/10/10, Tatiana Lloret Iglesias <[EMAIL PROTECTED]>: > Hi all! > > What regular expression do I need to convert Version: 1.2.3 to Version: > 1.2.4 ? > > I.e. my pattern is Version: number.

Re: Beginner Reg.Expression Question

2007-10-10 Thread Ashok Varma
Or You can also do ... $string =~ s/(\d+)$/$1+1/e; Ashok On 10/10/07, Rob Dixon <[EMAIL PROTECTED]> wrote: > > Tatiana Lloret Iglesias wrote: > > > > Hi all! > > > > What regular expression do I need to convert Version: 1.2.3 to > Version: > > 1.2.4 ? > > > > I.e. my pattern is Version: num

Re: Beginner Reg.Expression Question

2007-10-10 Thread Rob Dixon
Tatiana Lloret Iglesias wrote: Hi all! What regular expression do I need to convert Version: 1.2.3 to Version: 1.2.4 ? I.e. my pattern is Version: number.number.number and from that i need Version: number.number.number+1 After the : i can have a space or not... Hello Tatiana This will

Beginner Reg.Expression Question

2007-10-10 Thread Tatiana Lloret Iglesias
Hi all! What regular expression do I need to convert Version: 1.2.3 to Version: 1.2.4 ? I.e. my pattern is Version: number.number.number and from that i need Version: number.number.number+1 After the : i can have a space or not... Thanks! T