Re: Qn on classes, inheritance, and threads

2006-03-28 Thread Foo Ji-Haw
Hey William, Ok, I've dug around, and I've got a working solution to my problem. It's a bit ugly though: package BaseClass; ... sub doThis { my $pFunc; eval '$pFunc = \&'.ref($this).'::doThat'; return threads->new($pFunc,$this); } package DerivedClass; ... sub doThat { ... } Essenti

Re: Qn on classes, inheritance, and threads

2006-03-28 Thread Foo Ji-Haw
Hello William, Thanks for the tip. In your example you did this: threads->create(\&DerivedClass::doThat,$this); And it seems to work. But if I am to make the 'DerivedClass' portion dynamic (as it has to work with other subclasses eg DerivedClass2, DerivedClass3), how can I do it? I think i

Re: keys to hashref built from DBI

2006-03-28 Thread pDale
On 3/28/06, Bowie Bailey <[EMAIL PROTECTED]> wrote: > Mario R. Sanchez, Ph.D. wrote: > > hi pDale > > > > this is the entire code ... > > > > while(my $row_href = $sth->fetchrow_hashref) > >{ > > print "$row_href->{'area'}\n"; > >} > > foreach my $key (keys %$ro

RE: keys to hashref built from DBI

2006-03-28 Thread Bowie Bailey
Mario R. Sanchez, Ph.D. wrote: > hi pDale > > this is the entire code ... > > while(my $row_href = $sth->fetchrow_hashref) >{ > print "$row_href->{'area'}\n"; >} > foreach my $key (keys %$row_href) > { > print "hi\n"; > print "$key = ".$row_href->{$key}

Re: keys to hashref built from DBI

2006-03-28 Thread Mario R. Sanchez, Ph.D.
hi pDale this is the entire code ... while(my $row_href = $sth->fetchrow_hashref) { print "$row_href->{'area'}\n"; } foreach my $key (keys %$row_href) { print "hi\n"; print "$key = ".$row_href->{$key}."\n"; } = the "while" correctly outpu

Re: keys to hashref built from DBI

2006-03-28 Thread pDale
On 3/27/06, Mario R. Sanchez, Ph.D. <[EMAIL PROTECTED]> wrote: >> how can i get the column names - what i presume to be the keys to the>> hashref? assume that i just want to list the column names.>>> Try this:> foreach my $key (keys %$row_href) > {> print "$key = ".$row_href->{$key}."\n";> } tr

Re: Qn on classes, inheritance, and threads

2006-03-28 Thread Williamawalters
In a message dated 3/28/2006 5:50:21 A.M. Eastern Standard Time, [EMAIL PROTECTED] writes:   > Hi all,> > I have a need to do this (abstracted from the attached working code):> package BaseClass;> use threads;> > sub doThis> {> my $this = shift;> > threads->create(\&doThat,$this);

Qn on classes, inheritance, and threads

2006-03-28 Thread Foo Ji-Haw
Hi all, I have a need to do this (abstracted from the attached working code): package BaseClass; use threads; sub doThis { my $this = shift; threads->create(\&doThat,$this); } package DerivedClass; use base 'BaseClass'; sub new { my $class = shift; my $this = $class->SUPER::new;

Qn on classes, inheritance, and threads

2006-03-28 Thread Foo Ji-Haw
Hi all, I have a need to do this: package BaseClass; use threads; sub doThis { my $this = shift; threads->create(\doThat,$this); } package DerivedClass; use base 'BaseClass'; sub new { my $class = shift; my $this = $class->SUPER::new; return bless $this,$class; } sub doThat {