Re: smart matching

2011-10-06 Thread Shlomi Fish
On Wed, 5 Oct 2011 23:44:21 -0500 Chris Stinemetz wrote: > trying to learn smart matching in an exercise. > > Why does this program output "odd" when I input an even number? > A few comments on your code. > Thank you, > > Chris > > #!/usr/bin/perl > > use warnings; > use strict; > > use 5

Re: smart matching

2011-10-06 Thread timothy adigun
Hi Chris, I think you will need to work on your code to make it better or maybe this is just a dirty codes for practice. If not, there are some stuff you may have to weed out...some of which Shlomi Fish mentioned. However, to make your code work as you suppose, please check this little addition a

Regarding help in Threading

2011-10-06 Thread Vishal Gupta
Hi, I have to write a perl program (Parent script) which does the below 4 tasks simultaneously: 1. Executing a perl script in one shell. (Parent script) 2. Invoking a thread performing some tasks periodically lets say once in 15 min, and send a message when any task is completed, to parent

Re: Regarding help in Threading

2011-10-06 Thread Rob Coops
On Thu, Oct 6, 2011 at 11:30 AM, Vishal Gupta wrote: > > > > > > Hi, > > I have to write a perl program (Parent script) which does the below 4 tasks > simultaneously: > > 1. Executing a perl script in one shell. (Parent script) > 2. Invoking a thread performing some tasks periodically lets say onc

Re: Regarding help in Threading

2011-10-06 Thread Shlomi Fish
ׁHello, Vishal, On Thu, 6 Oct 2011 15:00:22 +0530 Vishal Gupta wrote: > > > > > > Hi, > > I have to write a perl program (Parent script) which does the below 4 tasks > simultaneously: > > 1. Executing a perl script in one shell. (Parent script) > 2. Invoking a thread performing some task

Re: John SJ Anderson is Perl Beginners list moderator

2011-10-06 Thread John SJ Anderson
On Fri, Sep 30, 2011 at 18:51, Octavian Rasnita wrote: > I would like to put a question. Is top-posting accepted on the list? I've thought about this for a while, and I think I've finally got something that should make everybody about equally annoyed. (There is no solution to this problem that w

Re: List Experience

2011-10-06 Thread John SJ Anderson
On Sat, Oct 1, 2011 at 10:05, Ron Weidner wrote: > > I've had mixed feelings about my > experience on this list so far.  I'm sharing these opinions because I > feel it would be awesome if this list seemed friendlier to beginners. I agree with you, and that's part of what motivated my volunteering

Re: John SJ Anderson is Perl Beginners list moderator

2011-10-06 Thread Zachary Zebrowski
++ some mail clients (eg. Gmail) make it very hard to bottom post. Thanks for not excluding me. :) On Oct 6, 2011 11:28 AM, "John SJ Anderson" wrote: > On Fri, Sep 30, 2011 at 18:51, Octavian Rasnita wrote: > >> I would like to put a question. Is top-posting accepted on the list? > > I've thoug

RE: John SJ Anderson is Perl Beginners list moderator

2011-10-06 Thread Bob McConnell
Lookout is another. I have to manually edit each line to turn this into a bottom post. They totally dropped the Usenet style reply option in the Office 2003 release. Bob McConnell -Original Message- From: Zachary Zebrowski [mailto:zak.zebrow...@gmail.com] Sent: Thursday, October 06, 2011

Re: smart matching

2011-10-06 Thread John SJ Anderson
On Thu, Oct 6, 2011 at 03:10, Shlomi Fish wrote: > Furthermore, I think you can only put when inside given and not arbitrary > code, > and that "when()" operates on the datum that was given to given(). I don't think there's any restriction on what code can be inside the 'given' block -- at least

Re: John SJ Anderson is Perl Beginners list moderator

2011-10-06 Thread Shawn H Corey
On 11-10-06 11:37 AM, Zachary Zebrowski wrote: some mail clients (eg. Gmail) make it very hard to bottom post. Thanks for not excluding me. :) I don't mind top posters but I wished more people would trim the quotes. Top posting makes people lazy and they include the entire quote, making the

Re: John SJ Anderson is Perl Beginners list moderator

2011-10-06 Thread Shawn H Corey
On 11-10-06 11:45 AM, Bob McConnell wrote: Lookout is another. Are people still using that? -- Just my 0.0002 million dollars worth, Shawn Confusion is the first step of understanding. Programming is as much about organization and communication as it is about coding. The secret to gr

Re: John SJ Anderson is Perl Beginners list moderator

2011-10-06 Thread Ali Nabavi
On Thu, Oct 6, 2011 at 11:51, Shawn H Corey wrote: > On 11-10-06 11:37 AM, Zachary Zebrowski wrote: > >> some mail clients (eg. Gmail) make it very hard to bottom post. Thanks >> for not excluding me. :) >> > > I don't mind top posters but I wished more people would trim the quotes. > Top postin

Re: John SJ Anderson is Perl Beginners list moderator

2011-10-06 Thread Zachary Zebrowski
On Thu, Oct 6, 2011 at 11:51 AM, Shawn H Corey wrote: > On 11-10-06 11:37 AM, Zachary Zebrowski wrote: > >> some mail clients (eg. Gmail) make it very hard to bottom post. Thanks >> for not excluding me. :) >> > > I don't mind top posters but I wished more people would trim the quotes. > Top post

Re: John SJ Anderson is Perl Beginners list moderator

2011-10-06 Thread John SJ Anderson
Okay, meta-topics are always on topic, but this one is pretty run into the ground and doesn't have anything to do with Perl -- let's let this thread die out, and get back to the beginner questions... thanks, john. -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands,

RE: Cannot bind a reference

2011-10-06 Thread Jeffrey Joh
Thank you for your help Rob. How can I write a code to go to next iteration of the foreach loop if there is a "Cannot bind a reference" error? Thanks, Jeffrey > Date: Sun, 2 Oct 2011 01:54:38 +0100 > From: rob.di...@gmx.com > To: beginners@perl.o

Re: Cannot bind a reference

2011-10-06 Thread Zachary Zebrowski
Try this syntax: my $dbh = DBI::connect("...",{RaiseError=>1}); # Add raise error to your dbh class, verbosity is good. my $sql = qq{insert into foo (col1,col2) values (?,?)}; # Seperate sql from prepare. my $sth = $dbh->prepare($sql); foreach my $x (@ary){ $sth->insert($x,'test'); } On Thu,

Re: List Experience

2011-10-06 Thread Mike Flannigan
On 10/3/2011 1:56 AM, Ronald Weidner wrote: I've had mixed feelings about my experience on this list so far. I'm sharing these opinions because I feel it would be awesome if this list seemed friendlier to beginners. Several years ago I subscribed to this list and unsubscribed almost as quick

Re: Capitalizing Acronyms

2011-10-06 Thread Marc
On Sep 8, 2011, at 10:13 AM, Rob Dixon wrote: > my $string = 'The Kcl Group'; > > $string =~ s/\b([aeiouy]{3,4}|[^aeiouy]{3,4})\b/\U$1/ig; > > print $string, "\n"; I'd like to revisit this, if I could. I've modified the above regex so as not to capitalize ordinal numbers, however I've

Re: Capitalizing Acronyms

2011-10-06 Thread Jim Gibson
On 10/6/11 Thu Oct 6, 2011 4:05 PM, "Marc" scribbled: > On Sep 8, 2011, at 10:13 AM, Rob Dixon wrote: > >> my $string = 'The Kcl Group'; >> >> $string =~ s/\b([aeiouy]{3,4}|[^aeiouy]{3,4})\b/\U$1/ig; >> >> print $string, "\n"; > > I'd like to revisit this, if I could. I've modified the abo

Re: Capitalizing Acronyms

2011-10-06 Thread Marc
On Oct 6, 2011, at 4:44 PM, Jim Gibson wrote: > You should go back to your original character class of [bcdfghjklmnpqrstvwxz] Making this change fixed the "Rex'S" problem, but it didn't capitalize LKJ because the rest of the code had capitalized the acronym as Lkj. So I changed that li