Gerald Richter wrote:
> 
> > sub new {
> >
> >       my $pkg = shift;
> >       my $fdatref = shift;
> >       my $database = 'patients';
> >       my $obj = bless {
> >               '_fdatref' => $fdatref,
> >               '_balances' => 0, ## array ref for balances
> >               '_prev_patnums' => 0, ## array ref for prev_patnums
> >               '_dbh' => SQLHANDLE->allocate($database)
> >       }, $pkg;
> >       return $obj;
> > }
> 
> One problem could be, if SQLHANDLE->allocate dies (e.g. in getdbh), then
> your object will never returned and will be undef in further [- -] blocks
> 
> You can wrap your constructor in an eval {  } to catch this case.
> 
OK - I can give this a try.  One thing we noticed though, was it seemed
that
we had a problem with %fdat.  When I foreached through %fdat it see what
was going on,
and prior to running anything else from the page which was called from
the database
which is triggering everything else, before running, the problems seemed
to go away.
We are running these pages from HTML::EMBPERL:exec
and I noticed that the latest release has a notice about a bug fix with
%fdat.  Can this be the source of the problem?

> 
> each [- -] is evaled as a separate anoymous sub,

Then the variables declared within the anonymous subroutines are global
to the
page being executed?  And the Page itself is in an EVAL block?

> if there are any [* *]
> blocks they are evaled in one sub together, which calls the other subs, but
> this are the current implementation details, which may change in the future
> (e.g. in Embperl 2.0). Anyway I will make sure that scoping remains the
> same.

OK

When the table loops come into play for the [$ WHILE $] come into the
code,
are they accefting the scoping in any way?  I noticed, for example, thay
$maxrow
seems to have local scope to the tables.  How is package level
varriables affected.
Obviously, modules have my scoped variable within them accessible only
through the 
object.  If we hit the tables or a loop, are the previous variables
holding the
object reference is still global and seen under these conditions with
the [- -]?

Thanks Mr Gerald (Yoda) Richter

Are you even in NYC?  Would love to get you to talk at one of our
Linux User group meetings.  I'll buy the beers.

-- 
Ruben I Safir
[EMAIL PROTECTED]

http://www.brooklynonline.com
Manager of Intranet Development NYU College of Dentistry
Resume:  http://www.wynn.com/jewish/resume.html

Perl Notes:
http://www.wynn.com/jewish/perl_course

Reply via email to