Re: grabbing text between two tokens

2008-04-14 Thread Chas. Owens
On Mon, Apr 14, 2008 at 7:40 PM, <[EMAIL PROTECTED]> wrote: > Thanks Gary, > But some of us may wish to know why $str =~ m/tokena(.*)tokenb/ms; did not > get all the things between tokena and tokenb into $str? > > This is how my mind think:- > (1) The /s switch means to be able to match across

Re: Troubleshooting SQL server

2008-04-14 Thread Chas. Owens
On Mon, Apr 14, 2008 at 7:11 PM, Jenda Krynicky <[EMAIL PROTECTED]> wrote: snip > > my $sql = q/SELECT Account,Last_Name,First_Name,Email_Address FROM > > prospects WHERE Email_Address='?'/; > > Drop the singlequotes. This way your SQL searches for a literal > questionmark in the Email_Addres

Re: trying to use IO::Handle

2008-04-14 Thread Richard Lee
Chas. Owens wrote: On Mon, Apr 14, 2008 at 12:50 AM, Richard Lee <[EMAIL PROTECTED]> wrote: snip my $start = qr/@{[ POSIX::strftime( '%b %e %H:', localtime time - ONE_HOUR ) ]}/; snip I will have to try out your POSIX solution as I have particular in adding space if date is s

Re: grabbing text between two tokens

2008-04-14 Thread Gunnar Hjalmarsson
[EMAIL PROTECTED] wrote: Gary Stainburn wrote: On Monday 14 April 2008 16:35, Sharan Basappa wrote: I am trying to capture the text between two tokens. These tokens always exist in pairs but can occur N times. I somehow dont get what I want. $str =~ m/tokena(.*)tokenb/ms; print $1; Try $str

Re: grabbing text between two tokens

2008-04-14 Thread itshardtogetone
Thanks Gary, But some of us may wish to know why $str =~ m/tokena(.*)tokenb/ms; did not get all the things between tokena and tokenb into $str? This is how my mind think:- (1) The /s switch means to be able to match across newlines. (2) .* means to match zero or more of anything. Henceforth s

Re: Troubleshooting SQL server

2008-04-14 Thread Jenda Krynicky
From: "Pat Rice" <[EMAIL PROTECTED]> > Hi all > I'm looking for some good ideas on trouble shooting SQL. > > as in I have wrote thsi code, but I wondering if there is any way we > can a debug level, so that it would tell me if the query failed. > eg. > my $sql = q/SELECT Account,Last_Name,First_N

Re: Fw: Perl maximum execution time

2008-04-14 Thread Jenda Krynicky
From: anthony brooke <[EMAIL PROTECTED]> > Thanks, I am using Apache 2 and Opera browser. So you mean configure through > my web server ? How if I run the code through the shell ? Normaly it's the web server's job to kill scripts that take too long. I bet there are people here that can help you

Re: Getting more than one match with regexp

2008-04-14 Thread Rob Dixon
Dr.Ruud wrote: > Rob Dixon schreef: >> >> my @files = $text =~ m#(http://.*?.mp3)"#g; > > Missing is escaping of the dot. > This would lead to mismatching "http://my-mp3.mp3";. Thank you Ruud -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http:

Re: Getting more than one match with regexp

2008-04-14 Thread Dr.Ruud
Rob Dixon schreef: > Jim wrote: >> I have some code (below) that retrieves an URL from $response- >> content. $response->content contains an RSS a retrieved RSS file. >> >> How would I retrieve all the URLs in $response->content instead of >> just the first one? >> >> if($response->content =~ m/

Re: Changing case of UTF-8 strings

2008-04-14 Thread Chas. Owens
On Apr 14, 2008, at 10:10, Paulo Antonio wrote: Hi all, I'm trying to change case of UTF-8 strings. I've read a bunch of documentation, but can't figure out how to do it right. Here is an example: === My code: use strict; use utf8; my $line; my $letter; while ($line = ) { chomp($line);

Re: Troubleshooting SQL server

2008-04-14 Thread Chas. Owens
On Apr 14, 2008, at 10:40, Jeff Pang wrote: On Mon, Apr 14, 2008 at 10:35 PM, Pat Rice <[EMAIL PROTECTED]> wrote: Hi all I'm looking for some good ideas on trouble shooting SQL. as in I have wrote thsi code, but I wondering if there is any way we can a debug level, so that it would tell me

Re: grabbing text between two tokens

2008-04-14 Thread Chas. Owens
On Apr 14, 2008, at 11:35, Sharan Basappa wrote: Hi, I am trying to capture the text between two tokens. These tokens always exist in pairs but can occur N times. I somehow dont get what I want. snip You might consider looking at Text::Balanced*. * http://search.cpan.org/dist/Text-Balanced/l

Re: split a string

2008-04-14 Thread Chas. Owens
On Apr 14, 2008, at 11:45, Dermot wrote: Hi, I am trying to split a string on every 9th character. I thought that this my @list = split(/.{9}/, $string); might do it but it doesn't work. I thought about using splice but the string is a scalar. If I coudl force it into an array that would

split a string

2008-04-14 Thread Dermot
Hi, I am trying to split a string on every 9th character. I thought that this my @list = split(/.{9}/, $string); might do it but it doesn't work. I thought about using splice but the string is a scalar. If I coudl force it into an array that would help. Has anyone got any ideas? Thanx, Dp. --

Re: grabbing text between two tokens

2008-04-14 Thread Gary Stainburn
On Monday 14 April 2008 16:35, Sharan Basappa wrote: > Hi, > > I am trying to capture the text between two tokens. These tokens > always exist in pairs but can occur N times. > I somehow dont get what I want. > > $str =~ m/tokena(.*)tokenb/ms; > print $1; > Try $str =~ m/tokena(.*?)tokenb/ms; The

Changing case of UTF-8 strings

2008-04-14 Thread Paulo Antonio
Hi all, I'm trying to change case of UTF-8 strings. I've read a bunch of documentation, but can't figure out how to do it right. Here is an example: === My code: use strict; use utf8; my $line; my $letter; while ($line = ) { chomp($line); utf8::upgrade($line); $line = lc($line);

grabbing text between two tokens

2008-04-14 Thread Sharan Basappa
Hi, I am trying to capture the text between two tokens. These tokens always exist in pairs but can occur N times. I somehow dont get what I want. e.g. In the example below, I would like to capture text between tokena and tokenb. So it should capture name1 and name2. $str = "tokena name: name1 t

Re: Getting more than one match with regexp

2008-04-14 Thread Rob Dixon
Jim wrote: > Hi all, > > I have some code (below) that retrieves an URL from $response- >> content. $response->content contains an RSS a retrieved RSS file. > > How would I retrieve all the URLs in $response->content instead of > just the first one? > > if($response->content =~ m/http:(.*?).mp3"

Re: Getting more than one match with regexp

2008-04-14 Thread Chas. Owens
On Mon, Apr 14, 2008 at 6:45 AM, Jim <[EMAIL PROTECTED]> wrote: snip > How would I retrieve all the URLs in $response->content instead of > just the first one? > > if($response->content =~ m/http:(.*?).mp3"/) > { > $url = "http:" . $1 . ".mp3"; > > } snip Try my @mp3 = $respo

Getting more than one match with regexp

2008-04-14 Thread Jim
Hi all, I have some code (below) that retrieves an URL from $response- >content. $response->content contains an RSS a retrieved RSS file. How would I retrieve all the URLs in $response->content instead of just the first one? if($response->content =~ m/http:(.*?).mp3"/) { $url = "

Re: Fw: Perl maximum execution time

2008-04-14 Thread Chas. Owens
On Mon, Apr 14, 2008 at 9:45 AM, anthony brooke <[EMAIL PROTECTED]> wrote: > > Thanks for the reply, but sometimes I don't know where is the code that cause > the infinite loop. > Is there such as thing as perl configuration file, to set the execution time > for any code, any where > in the progr

Re: Fw: Perl maximum execution time

2008-04-14 Thread anthony brooke
Thanks, I am using Apache 2 and Opera browser. So you mean configure through my web server ? How if I run the code through the shell ? - Original Message From: Jenda Krynicky <[EMAIL PROTECTED]> To: beginner perl mailling list Sent: Monday, April 14, 2008 22:31:35 Subject: Re: Fw: Perl

Re: Troubleshooting SQL server

2008-04-14 Thread Jeff Pang
On Mon, Apr 14, 2008 at 10:35 PM, Pat Rice <[EMAIL PROTECTED]> wrote: > Hi all > I'm looking for some good ideas on trouble shooting SQL. > > as in I have wrote thsi code, but I wondering if there is any way we > can a debug level, so that it would tell me if the query failed. > eg. > my $sql = q

Troubleshooting SQL server

2008-04-14 Thread Pat Rice
Hi all I'm looking for some good ideas on trouble shooting SQL. as in I have wrote thsi code, but I wondering if there is any way we can a debug level, so that it would tell me if the query failed. eg. my $sql = q/SELECT Account,Last_Name,First_Name,Email_Address FROM prospects WHERE Email_Addre

Re: Fw: Perl maximum execution time

2008-04-14 Thread Jenda Krynicky
From: anthony brooke <[EMAIL PROTECTED]> > Thanks for the reply, but sometimes I don't know where is the code > that cause the infinite loop. Is there such as thing as perl > configuration file, to set the execution time for any code, any where > in the program just like php.ini file. Thanks. Dep

Fw: Perl maximum execution time

2008-04-14 Thread anthony brooke
Thanks for the reply, but sometimes I don't know where is the code that cause the infinite loop. Is there such as thing as perl configuration file, to set the execution time for any code, any where in the program just like php.ini file. Thanks. - Original Message From: Chas. Owens <[EM

Re: questions from Learning Perl

2008-04-14 Thread Randal L. Schwartz
> "Chas" == "Chas Owens" <[EMAIL PROTECTED]> writes: Chas> I remember in Learning Perl 2nd edition AKA "the version that never existed". In other words, please consider anything in that book "non-canonical", as the SciFi geeks say. Long story. -- Randal L. Schwartz - Stonehenge Consulting

Re: [PBML] Setting arbitrary-depth hash from file

2008-04-14 Thread Randal L. Schwartz
> "(Randal" == (Randal L Schwartz) <[EMAIL PROTECTED]> writes: (Randal> I would say that you're not paying attention if you think *this list* (Randal> has better answers or is faster. Monks beats any list hands down (Randal> for accuracy and speed. Ouch. I didn't realize you had crossmailed

Re: Debugger in PErl

2008-04-14 Thread jeevs
On Apr 11, 6:08 pm, [EMAIL PROTECTED] (Jeevs) wrote: > Thanks for the pointer Jenda And Chas.. > A little problem here... I was able to debug a sample script from > command line... > > However when i used the !#c:/perl5.10/bin/perl.exe -d:pktdb to debug > cgi scripts through browser nothing happe