Re: how to shorten this code ? x occur how many times in variable

2008-05-07 Thread Richard Lee
John W. Krahn wrote: Richard Lee wrote: Rob Dixon wrote: returns the number of colons found but leaves them untouched. Similarly $str =? tr/\t /_/; this is great!! use warnings; use strict; my $str = 'ab:cd:ef:g:hi::now;'; print $str =~ tr/:// . "\n"; print $str =~ tr/:b/_X/ . "\n"; p

Re: how to shorten this code ? x occur how many times in variable

2008-05-07 Thread John W. Krahn
Richard Lee wrote: Rob Dixon wrote: returns the number of colons found but leaves them untouched. Similarly $str =? tr/\t /_/; this is great!! use warnings; use strict; my $str = 'ab:cd:ef:g:hi::now;'; print $str =~ tr/:// . "\n"; print $str =~ tr/:b/_X/ . "\n"; print "$str\n"; ././.

Re: comparing kit names

2008-05-07 Thread Gunnar Hjalmarsson
John W. Krahn wrote: Gunnar Hjalmarsson wrote: perl_learner wrote: On May 6, 10:08 am, [EMAIL PROTECTED] (Gunnar Hjalmarsson) wrote: my @kits = split ' ', $KIT_LIST; Also with little change, "my @kits = split ' ', $KIT_LIST; ## added an extra space to split" I am getting the desired

Re: how to shorten this code ? x occur how many times in variable

2008-05-07 Thread Richard Lee
Rob Dixon wrote: Richard Lee wrote: John W. Krahn wrote: Richard Lee wrote: Can you please tell me how to shorten this? my @an = split(//); my @num = grep { $_ eq ':' } @an ; I was trying to see how many : occur in variable but didn't know how to do it fast so i did it like

Re: comparing kit names

2008-05-07 Thread John W. Krahn
Gunnar Hjalmarsson wrote: perl_learner wrote: On May 6, 10:08 am, [EMAIL PROTECTED] (Gunnar Hjalmarsson) wrote: my @kits = split ' ', $KIT_LIST; Also with little change, "my @kits = split ' ', $KIT_LIST; ## added an extra space to split" I am getting the desired output. The extra sp

Re: how to shorten this code ? x occur how many times in variable

2008-05-07 Thread Rob Dixon
Richard Lee wrote: > > John W. Krahn wrote: > >> Richard Lee wrote: >> >>> Can you please tell me how to shorten this? >>> >>> my @an = split(//); >>> my @num = grep { $_ eq ':' } @an ; >>> >>> I was trying to see how many : occur in variable but didn't know how >>> to do it fast so i did it like

Re: Text formatting issues

2008-05-07 Thread Dr.Ruud
hotkitty schreef: > #!/usr/bin/perl Missing: use strict; > use warnings; > $main_text->text("$newtext"); Why quoted? -- Affijn, Ruud "Gewoon is een tijger." -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/

Re: Regex help?

2008-05-07 Thread Dr.Ruud
"sanket vaidya" schreef: > use warnings; > use strict; > my $i=1; > while($i<=10) > { > $_ = "abcpqr"; > $_=~ s/(?=pqr)/$i/; > print "$_\n"; > $i++; > } > [...] > > The expected output is > abc001pqr > [...] > Can any one suggest me how to get that output using regex. i.e. Can > t

Re: Perl-GD module installation

2008-05-07 Thread Dr.Ruud
sivasakthi schreef: > Ruud: >> GD can be installed with the help of CPAN. > > I have tried your suggestions .. but it failed to install .. the error > statements are attached with this mail. I see there this: ** WARNING: found gd.h header file in /usr/includegd.h, but it is expected at /usr/loc

Re: Passing Creadentials and parameters through http headers

2008-05-07 Thread yitzle
Take a look at WWW::Mechanize, specifically the submit_form() function. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/

install module problem

2008-05-07 Thread John Wilson
Hi, I'm trying to install a perl module (Net::SSLeay) on a Sun unix box running Solaris 9. In doing the make, I get a message from the shell in the output: "sh: gcc: cannot execute". To me this sounds like it's saying it doesn't know what/where gcc is. My gcc is in /usr/local/bin, but /us

Re: Text formatting issues

2008-05-07 Thread Rob Dixon
hotkitty wrote: > First and foremost thanks for all the help I've received on this > board, especially Gunnar who keeps this place running! > > I've come a long way in my code and am trying to format some text and > then put it into a nice pdf file. My problem is putting the formatted > text into

Re: Text formatting issues

2008-05-07 Thread Gunnar Hjalmarsson
hotkitty wrote: First and foremost thanks for all the help I've received on this board, especially Gunnar who keeps this place running! Thanks, but this place is kept running by quite a few helpful contributors. I've come a long way in my code and am trying to format some text and then put it

Re: comparing kit names

2008-05-07 Thread Gunnar Hjalmarsson
perl_learner wrote: On May 6, 10:08 am, [EMAIL PROTECTED] (Gunnar Hjalmarsson) wrote: perl_learner wrote: my @kits = $KIT_LIST; How many elements do you think there are in @kits? I have ~100 elements @kits. Why did you ask this question? Because when you just said my @kits = $KIT_LI

Re: chaining defines

2008-05-07 Thread Peter Scott
On Tue, 06 May 2008 18:04:00 +0200, Jenda Krynicky wrote: > From: Robert Hicks <[EMAIL PROTECTED]> >> Is there anything wrong with: >> >> if ( defined $one && defined $two && $one eq $two ) { >> do something >> } > > As far as I can tell not. I was afraid the operator precedence might >

Re: Perl-GD module installation

2008-05-07 Thread sivasakthi
> GD can be installed with the help of CPAN. > > http://www.libgd.org/releases/ > > then, unpack and install > > tar xvf gd-2.0.35.tar > cd gd-2.0.35 > ./configure > make > make install > > then reinstall the latest GD perl module using cpan: > perl -MCPAN -e shell > CPAN>install GD > > --

Re: Regex help?

2008-05-07 Thread John W. Krahn
sanket vaidya wrote: HI all, Hello, 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

Can't get Text::Balanced::extract_quotelike to work.

2008-05-07 Thread Tony Jones
Hi, I've been trying to use the extract_quotelike and extract_delimited functions to extract a SQL statement from a line of C++ code but I just can't get it to work. The script is searching all .cpp files in a folder for SQL commands; it manages to extract some but not all of them. I'm using a ba

Re: Perl-GD module installation

2008-05-07 Thread Dr.Ruud
sivasakthi schreef: > I have installed the following rpms, > > gd-devel-2.0.28-4.4E.1 > gd-2.0.28-4.4E.1 > gdk-pixbuf-0.22.0-17.el4.3 > gdm-2.6.0.5-7.rhel4.12 > gdbm-1.8.0-24 > > after that tried to build GD module, during make it shows following, GD can be installed with the help of CPAN. h

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

Re: comparing kit names

2008-05-07 Thread perl_learner
On May 6, 10:08 am, [EMAIL PROTECTED] (Gunnar Hjalmarsson) wrote: > perl_learner wrote: > > On May 5, 3:26 am, [EMAIL PROTECTED] (Gunnar Hjalmarsson) wrote: > > >>      my @kits = qw( aaa.t.z aaa_d.t.z bbb.t.z bbb_d.t.z > >>                    ccc.t.z ccc_d.t.z ddd.t.z eee.t.z ); > > >>      my %ha

Text formatting issues

2008-05-07 Thread hotkitty
First and foremost thanks for all the help I've received on this board, especially Gunnar who keeps this place running! I've come a long way in my code and am trying to format some text and then put it into a nice pdf file. My problem is putting the formatted text into the pdf and for it to displa

re: find path to current file, NOT working directory

2008-05-07 Thread morphis
Apologies, I had looked at special variables, but not far enough, in winxp $0 provides a full path of the current script. Sorry for the bother Robert -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/

Passing Creadentials and parameters through http headers

2008-05-07 Thread Prabu Ayyappan
Hi all, I want to Pass the credentials and the Post parameters in a request and need to get the response content. I tried with the following approach. 1) Credentials are getting passed correctly however am not getting the parameter passed. 2) If am passing the credentials in the url it is w

Re: Perl-GD module installation

2008-05-07 Thread Rob Coops
In that case there might be something strange about your flavor of *nix looking at the man page of my locally installed ld. *-larchive --library=archive Add archive file archive to the list of files to link. This option may be used any number of times. ld will search its path-list fo

Re: Perl-GD module installation

2008-05-07 Thread sivasakthi
On Wed, 2008-05-07 at 09:31 +0200, Rob Coops wrote: > I would say this is the problem: > /usr/bin/ld: cannot find -lfreetype > > At least that is what the compiler says the problem is and I guess it > knows better then I do. So time to install the freetype libs. > (http://www.freetype.org/) >

Re: Perl-GD module installation

2008-05-07 Thread Rob Coops
I would say this is the problem: */usr/bin/ld: cannot find -lfreetype* At least that is what the compiler says the problem is and I guess it knows better then I do. So time to install the freetype libs. ( http://www.freetype.org/) On Wed, May 7, 2008 at 9:05 AM, sivasakthi <[EMAIL PROTECTED]> w

Re: how to shorten this code ? x occur how many times in variable

2008-05-07 Thread Richard Lee
John W. Krahn wrote: Richard Lee wrote: Can you please tell me how to shorten this? my @an = split(//); my @num = grep { $_ eq ':' } @an ; I was trying to see how many : occur in variable but didn't know how to do it fast so i did it like above... I would like to see as many way different w

Re: Perl-GD module installation

2008-05-07 Thread sivasakthi
I have installed the following rpms, gd-devel-2.0.28-4.4E.1 gd-2.0.28-4.4E.1 gdk-pixbuf-0.22.0-17.el4.3 gdm-2.6.0.5-7.rhel4.12 gdbm-1.8.0-24 after that tried to build GD module, during make it shows following, # make /usr/bin/perl "-Iblib/arch" "-Iblib/lib" GD/Image.pm.PLS GD/Image.pm Extractin