Re: Good resources on CGI programming with Perl

2011-09-08 Thread Alan Haggai Alavi
Hello Parag, > Could some please suggest any good online resources on learning CGI > programming with Perl Curtis "Ovid" Poe's CGI course is popular: http://web.archive.org/web/20070709150107/http://users.easystreet.com/ovid/cgi_course/ Regards, Alan Haggai Alavi. -- The difference makes the di

Re: perl help

2011-09-08 Thread Rob Dixon
On 08/09/2011 20:58, Chris Stinemetz wrote: What would be the best way to omit any record when varible $dist is null or not> 1 ? I am not sure my attempt is correct with the ternary operator with length function. It seems that $dist is just being assinged 0 when the expression $dist is not> 1.

Re: Good resources on CGI programming with Perl

2011-09-08 Thread Jeff Pang
08 сентября 2011, 23:17 от Parag Kalra : > Hi, > > Could some please suggest any good online resources on learning CGI > programming with Perl > Maybe this book is the best one from my experience: http://shop.oreilly.com/product/9781565924192.do Or there is a free training book from there: h

perl help

2011-09-08 Thread Chris Stinemetz
What would be the best way to omit any record when varible $dist is null or not > 1 ? I am not sure my attempt is correct with the ternary operator with length function. It seems that $dist is just being assinged 0 when the expression $dist is not > 1. Any help is greatly appreciated. Thank you,

Good resources on CGI programming with Perl

2011-09-08 Thread Parag Kalra
Hi, Could some please suggest any good online resources on learning CGI programming with Perl Also please let me know the goods for the same. Thanks, Parag -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/

Re: Capitalizing Acronyms

2011-09-08 Thread Marc
On Sep 8, 2011, at 10:13 AM, Rob Dixon wrote: > $string =~ s/\b([aeiouy]{3,4}|[^aeiouy]{3,4})\b/\U$1/ig; Thanks to everyone who responded. I was trying to be concise but I went about it the wrong way and ended up creating more work for myself. I like the above code as it allows me to

Re: Capitalizing Acronyms

2011-09-08 Thread Shlomi Fish
On Thu, 8 Sep 2011 09:55:33 -0700 Marc wrote: > Hi Shlomi, > > > The problem here that /g confuses Perl and puts it in the \G anchor mode. > > Removing both /g fixes the problem. Some other notes: > > > > 1. You don't really need to say [...]+ inside the regex. [] here would > > be > > eno

Re: Capitalizing Acronyms

2011-09-08 Thread Rob Dixon
On 08/09/2011 16:58, Marc wrote: use strict; use warnings; my $string = 'The Kcl Group'; my @words = split(/ /, $string); my @new_words; foreach my $word (@words) { if ((length $word>= 3 and length $word<= 4) and ($word !~ m/[aeiouy]+/gi or $word !~ m/[bcdfghjklmnpqrstvwxz]+/gi)) {

Re: Capitalizing Acronyms

2011-09-08 Thread Uri Guttman
> "M" == Marc writes: M> Jim and David, >> m/^[aeiouy]+$/i M> I tried your suggestions but it still gives the same result: M>my $string = 'Off The Menu'; M>my @words = split(/ /, $string); M>my @new_words; M>foreach my $word (@words) { M>

Re: Capitalizing Acronyms

2011-09-08 Thread Uri Guttman
> ""D" == "Wagner, David <--- Sr Programmer Analyst --- CFS" > > writes: "D> ! ($word =~ m/^[aeiouy]+&/gi or $word =~ m/^[bcdfghjklmnpqrstvwxz]+&/gi) "D> This forces a start and end of on $word and I like the positive of if ONLY vowels plus Y or ONLY consonants. SO it is one way o

Re: Capitalizing Acronyms

2011-09-08 Thread Brandon McCaig
On Thu, Sep 8, 2011 at 11:58 AM, Marc wrote: > I'm trying to capitalize 3 and 4 letter words that contain > only vowels or consonants, but not both.  The code I've come > up with is not working correctly.  Given the string > 'The Kcl Group', it should return 'The KCL Group' but it is > also capita

Re: tr/// and unicode

2011-09-08 Thread Uri Guttman
> "ML" == Matthias Leopold writes: ML> Am 2011-09-08 10:53, schrieb Uri Guttman: >>> "ML" == Matthias Leopold writes: >> ML> perl -e '$_ = "äö"; tr/"ä","ö"/"ae","oe"/; print $_."\n";' >> >> not that i do unicode much but that tr/// is wrong. it takes a single >> string in

Re: Capitalizing Acronyms

2011-09-08 Thread Jim Gibson
On 9/8/11 Thu Sep 8, 2011 9:38 AM, "Marc" scribbled: > Jim and David, > >> m/^[aeiouy]+$/i > > I tried your suggestions but it still gives the same result: > > my $string = 'Off The Menu'; > > my @words = split(/ /, $string); > my @new_words; > foreach my $word (@words) { > if ((length $wo

Re: Capitalizing Acronyms

2011-09-08 Thread Marc
Hi Shlomi, > The problem here that /g confuses Perl and puts it in the \G anchor mode. > Removing both /g fixes the problem. Some other notes: > > 1. You don't really need to say [...]+ inside the regex. [] here would be > enough. Unfortunately, removing the /g and the + doesn't help

Re: Capitalizing Acronyms

2011-09-08 Thread timothy adigun
Hi Marc, Please check >>> comment in your code below: use strict; use warnings; my $string = 'The Kcl Group'; my @words = split(/ /, $string); my @new_words; foreach my $word (@words) { >>> if ((length $word >= 3 and length $word <= 4) and ($word !~ m/[aeiouy]+/gi or $word !~ m/[bcdf

Re: Capitalizing Acronyms

2011-09-08 Thread Marc
Jim and David, > m/^[aeiouy]+$/i I tried your suggestions but it still gives the same result: my $string = 'Off The Menu'; my @words = split(/ /, $string); my @new_words; foreach my $word (@words) { if ((length $word >= 3

Re: Capitalizing Acronyms

2011-09-08 Thread Shlomi Fish
Hi Marc, On Thu, 8 Sep 2011 08:58:09 -0700 Marc wrote: > I'm trying to capitalize 3 and 4 letter words that contain only vowels > or consonants, but not both. The code I've come up with is not working > correctly. Given the string 'The Kcl Group', it should return 'The KCL > Group' bu

RE: need helps

2011-09-08 Thread Zhu, Qichao
Hi There are two arrays @a = [[a,b,c]...[d,e]...[f]...[g,h]...] @b = [[...],[...,a,..,c,...,b...],[d],[e],[g...h]...] How can I make an arithmetic to detected that. if (element of array @a include by the element of array @b one time){ True; Else { False ; } **

Re: Capitalizing Acronyms

2011-09-08 Thread Jim Gibson
On 9/8/11 Thu Sep 8, 2011 8:58 AM, "Marc" scribbled: > I'm trying to capitalize 3 and 4 letter words that contain only vowels or > consonants, but not both. The code I've come up with is not working > correctly. Given the string 'The Kcl Group', it should return 'The KCL Group' > but it is al

RE: Capitalizing Acronyms

2011-09-08 Thread Wagner, David --- Sr Programmer Analyst --- CFS
>-Original Message- >From: Marc [mailto:sono...@fannullone.us] >Sent: Thursday, September 08, 2011 9:58 >To: Perl Beginners >Subject: Capitalizing Acronyms > > > I'm trying to capitalize 3 and 4 letter words that contain only >vowels or consonants, but not both. The code I've come up

Re: need helps

2011-09-08 Thread Shlomi Fish
Hi, On Thu, 8 Sep 2011 16:00:43 + "Zhu, Qichao" wrote: > Hi > > There are two arrays > > @a = [[a,b,c]...[d,e]...[f]...[g,h]...] > @b = [[...],[...,a,..,c,...,b...],[d],[e],[g...h]...] > I don't understand this notation. Are these arrays of arrays? > How can I make an arithmetic to dete

Capitalizing Acronyms

2011-09-08 Thread Marc
I'm trying to capitalize 3 and 4 letter words that contain only vowels or consonants, but not both. The code I've come up with is not working correctly. Given the string 'The Kcl Group', it should return 'The KCL Group' but it is also capitalizing the word 'THE'. What am I doing wrong

Re: Fwd: My Blog on Perl

2011-09-08 Thread meerkatze
great Emeka, please, go on with the blog! ola Quoting Emeka : Hello All, I have written a blog on Perl. It just has basic stuff. I would want you to go through and comment. That way it will help me to re-enforce what I have learned. http://emekamicro.blogspot.com/2011/09/perl-here-i-come.html

Re: Assigning to Substr

2011-09-08 Thread Rob Dixon
On 07/09/2011 20:49, Emeka wrote: On Wed, Sep 7, 2011 at 8:00 PM, Rob Dixon wrote: On Wed, Sep 7, 2011 at 8:08 PM, Emeka wrote: On 06/09/2011 13:04, Emeka wrote: Could someone explain what Perl does behind here? Assign to Substring.. substr($string, 0 , 5) = 'Greetings'; What do you wa

Re: unsusbcribe

2011-09-08 Thread Shlomi Fish
Hi Ganesh, On Thu, 8 Sep 2011 16:02:15 +0530 ganesh vignesh wrote: > that won't unsubscribe you. To unsubscribe follow the instructions in the list's footer: To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.

Re: unsusbcribe

2011-09-08 Thread Jeff Pang
please send an empty message to beginners-unsubscr...@perl.org rather than sending it to the list. 08 сентября 2011, 14:32 от ganesh vignesh : > > > -- Jeff Pang jeffp...@mail.ru

unsusbcribe

2011-09-08 Thread ganesh vignesh

Re: tr/// and unicode

2011-09-08 Thread Matthias Leopold
Am 2011-09-08 12:22, schrieb John W. Krahn: Matthias Leopold wrote: perl -e '$_ = "ao"; tr/"a","o"/"b","p"/; print $_."\n";' works as (i) expected -> "bp" from perlop: tr/SEARCHLIST/REPLACEMENTLIST/cds LIST in SEARCHLIST and REPLACEMENTLIST refers to a list of characters. If we rearrange y

Re: tr/// and unicode

2011-09-08 Thread John W. Krahn
Matthias Leopold wrote: perl -e '$_ = "ao"; tr/"a","o"/"b","p"/; print $_."\n";' works as (i) expected -> "bp" from perlop: tr/SEARCHLIST/REPLACEMENTLIST/cds LIST in SEARCHLIST and REPLACEMENTLIST refers to a list of characters. If we rearrange your example above: perl -e ' $_ = "ao"; tr{

Re: tr/// and unicode

2011-09-08 Thread Jeff Pang
Hi, You might want s/// operator. For example, $ perl -le '$str="中文";$str=~s/中文/Chinese/;print $str' Chinese $ env|grep LANG LANG=en_US.UTF-8 08 сентября 2011, 12:35 от Matthias Leopold : > hi, > > perl -e '$_ = "äö"; tr/"ä","ö"/"ae","oe"/; print $_."\n";' > > expected result: aeoe > actual

Re: tr/// and unicode

2011-09-08 Thread Matthias Leopold
Am 2011-09-08 10:53, schrieb Uri Guttman: "ML" == Matthias Leopold writes: ML> perl -e '$_ = "äö"; tr/"ä","ö"/"ae","oe"/; print $_."\n";' not that i do unicode much but that tr/// is wrong. it takes a single string in each part, not lists of "" strings. perl -e '$_ = "ao"; tr/"a","o"/"b

Re: tr/// and unicode

2011-09-08 Thread Uri Guttman
> "ML" == Matthias Leopold writes: ML> perl -e '$_ = "äö"; tr/"ä","ö"/"ae","oe"/; print $_."\n";' not that i do unicode much but that tr/// is wrong. it takes a single string in each part, not lists of "" strings. and it can't replace 1 char with 2. you need s/// for that. this works (as i

tr/// and unicode

2011-09-08 Thread Matthias Leopold
hi, perl -e '$_ = "äö"; tr/"ä","ö"/"ae","oe"/; print $_."\n";' expected result: aeoe actual result: aeae why? thx matthias -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/