Re: How to avoid using the slow array subscripting operator?

2011-05-25 Thread Uri Guttman
> "XL" == Xi Liu writes: XL> I translated a program from c to perl.but the perl program cost 15 seconds XL> compare to the original c one cost only less than 1 second, I guess this XL> might be the result of I literally translated the program, using a lot of XL> array subscripts. Afte

How to avoid using the slow array subscripting operator?

2011-05-25 Thread Xi Liu
Hi all: I translated a program from c to perl.but the perl program cost 15 seconds compare to the original c one cost only less than 1 second, I guess this might be the result of I literally translated the program, using a lot of array subscripts. After I profile the perl program, it turned out my

Re: reg exp

2011-05-25 Thread Dr.Ruud
On 2011-05-25 16:39, Irfan Sayed wrote: i have string like this "2011/05/25 07:24:58 -0700 PDT" i need to match "2011/05/25" i wrote reg ex like this: ^\d\d\d\d//\d\d/\d\d$ but it is not working code is like this $lin = "2011/05/25 07:24:58 -0700 PDT"; $lin =~ m/^\d\d\d\d//\d\d/\d\d$/; print

Re: reg exp

2011-05-25 Thread Jim Gibson
At 8:11 AM +0530 5/26/11, Abhinav Kukreja wrote: hi, suppose i have a string that contains n number of date patterns in the string. "2011/05/25 07:24:58 -0700 PDT 2011/04/28 2023/23/45" how can i extract all such patterns. Use a regular expression that matches just those string

Re: reg exp

2011-05-25 Thread Abhinav Kukreja
hi, suppose i have a string that contains n number of date patterns in the string. "2011/05/25 07:24:58 -0700 PDT 2011/04/28 2023/23/45" how can i extract all such patterns. On Wed, May 25, 2011 at 10:08 PM, Rob Dixon wrote: > On 25/05/2011 15:39, Irfan Sayed wrote: > > hi, > >

RE: Basic question on arrays $ vs @

2011-05-25 Thread Tim Lewis
Thanks Uri. That makes perfect sense. -Original Message- From: Uri Guttman [mailto:u...@stemsystems.com] Sent: Wednesday, May 25, 2011 1:37 PM To: Tim Lewis Cc: beginners@perl.org Subject: Re: Basic question on arrays $ vs @ > "TL" == Tim Lewis writes: TL> This is a very basic q

Re: Basic question on arrays $ vs @

2011-05-25 Thread Uri Guttman
> "TL" == Tim Lewis writes: TL> This is a very basic question on arrays and referring to the TL> elements. In referring to the elements, I know that it is correct TL> practice to use $ instead of @, but I know that Perl allows the @. TL> My simple question is what is the difference.

Basic question on arrays $ vs @

2011-05-25 Thread Tim Lewis
This is a very basic question on arrays and referring to the elements. In referring to the elements, I know that it is correct practice to use $ instead of @, but I know that Perl allows the @. My simple question is what is the difference. I have looked at different Perl tutorials, but have not

Re: reg exp

2011-05-25 Thread Rob Dixon
On 25/05/2011 15:39, Irfan Sayed wrote: > hi, > > i have string like this > "2011/05/25 07:24:58 -0700 PDT" i need to match "2011/05/25" > i wrote reg ex like this: ^\d\d\d\d//\d\d/\d\d$ but it is not working > > code is like this > > > $lin = "2011/05/25 07:24:58 -0700 PDT"; > $lin =~ m/^\d\d

Re: reg exp

2011-05-25 Thread Shawn H Corey
On 11-05-25 10:39 AM, Irfan Sayed wrote: hi, i have string like this "2011/05/25 07:24:58 -0700 PDT" i need to match "2011/05/25" i wrote reg ex like this: ^\d\d\d\d//\d\d/\d\d$ but it is not working code is like this $lin = "2011/05/25 07:24:58 -0700 PDT"; $lin =~ m/^\d\d\d\d//\d\d/\d\d$/;

Re: reg exp

2011-05-25 Thread Jim Gibson
At 7:39 AM -0700 5/25/11, Irfan Sayed wrote: hi, i have string like this "2011/05/25 07:24:58 -0700 PDT" i need to match "2011/05/25" i wrote reg ex like this: ^\d\d\d\d//\d\d/\d\d$ but it is not working code is like this $lin = "2011/05/25 07:24:58 -0700 PDT"; $lin =~ m/^\d\d\d\d//\d\

Re: reg exp

2011-05-25 Thread Irfan Sayed
thanks it worked From: Marco van Kammen To: Irfan Sayed ; Perl Beginners Sent: Wednesday, May 25, 2011 8:22 PM Subject: RE: reg exp Surely not perfect but this seems to work... $lin = "2011/05/25 07:24:58 -0700 PDT"; $lin =~ /(^\d+\/\d+\/\d+).*/; print "$1\n

RE: reg exp

2011-05-25 Thread Marco van Kammen
Surely not perfect but this seems to work... $lin = "2011/05/25 07:24:58 -0700 PDT"; $lin =~ /(^\d+\/\d+\/\d+).*/; print "$1\n"; Marco van Kammen Applicatiebeheerder Mirabeau | Managed ServicesDr. C.J.K. van Aalstweg 8F 301, 1625 NV Hoorn +31(0)20-5950550 - www.mirabeau.nl Please c

reg exp

2011-05-25 Thread Irfan Sayed
hi, i have string like this "2011/05/25 07:24:58 -0700 PDT"  i need to match "2011/05/25" i wrote reg ex like this: ^\d\d\d\d//\d\d/\d\d$ but it is not working code is like this $lin = "2011/05/25 07:24:58 -0700 PDT"; $lin =~ m/^\d\d\d\d//\d\d/\d\d$/; print "$lin\n"; plz suggest

Re: Perl For system admin

2011-05-25 Thread Shlomi Fish
Hi Fudmer, next time, please reply to all recipients and don't send the reply only to me. See below for my response: On Wednesday 25 May 2011 13:53:53 fudmer rieley wrote: > I c/n get the referenced link to open.. said page not found? > http://search.cpan.org/~abigail/Regexp-Common-2011041701/li

problem with dbi oracle blob

2011-05-25 Thread Marco van Kammen
Hi List, I'm struggeling with the following: There is a blob field in the oracle db which contains xml... I want to read this blob and make a single xml file out of it... Now when using the code below I get the data out of the blob with parts of xml but its all messed up... ’^@^Esr^@^Porg.j

Re: [META] Why I Often Refer People to http://perl-begin.org/ .

2011-05-25 Thread Shlomi Fish
Hi Leo, On Sunday 22 May 2011 21:39:13 Leo Lapworth wrote: > Hi, > > Please direct any replies to this to me off-list, to save the list > from off topic. > Sorry, but I'm replying to the list, so everyone will know what I think. There are no secrets in a society. This is not "off-topic" here.