[freeside] Stuck on a hashref and mod_perl

Stephen Amadei amadei at dandy.net
Thu Jun 22 15:05:12 PDT 2000


On Thu, 22 Jun 2000, ivan wrote:

> Now that it's there, we should probably move this over to the devel list.

That's right... I completely forgot about the devel list.  I am subbed to
the devel list, but I cannot remember the address.  Sorry...
 
> So I'd be interested getting a copy of those changes if you can isolate
> them.

Oh... O.K... I'll clean then up and post them.
 
> > but apparently this upsets the 'majik' holding the PERL together, and I
> > get a 
> >  "Can't call method "hashref" on an undefined value at
> >  d:/apache/htdocs/freeside/browse/svc_acct_pop.pl line 65"
> > I think I understand the error... but I don't understand why my valid
> > hash in "new" doesn't come out in line 65 or svc_acct_pop.pl:
> >  my($hashref)=$svc_acct_pl->hashref;
> 
> I'm assuming you've changed htdocs/browse/svc_acct_pop.cgi to
> svc_acct_pop.pl; seems like you've got that working fine.  I'm confused as
> to why you've also changed it in that line; here's the relevant section of
> code:

Yes, I was originally using Lotus Go Domino Web Server for OS/2, but since
it is a end-of-life product, I installed Apache/2 1.3.12.  Lotus didn't 
care for the .cgi extensions, but now that I am on Apache again, I'll be
changing them all back to .cgi... 

>   foreach $svc_acct_pop ( sort { 
>     $a->getfield('popnum') <=> $b->getfield('popnum')
>   } qsearch('svc_acct_pop',{}) ) {
>     my($hashref)=$svc_acct_pop->hashref;
> 
> $svc_acct_pop in the last line references the $svc_acct_pop in the foreach
> statement.
> 
> One possibility is that since you've changed it to $svc_acct_pl, that
> variable is automatically created when referenced with the undefined
> value.  This is the sort of trap that `use strict;' is supposed to avoid
> (see `perldoc strict') - have you removed it?

Sorry, my idiocy got me twice in this email... svc_acct_pl is a typo.
The foreach block above is exactly as mine stands... it's the
my(hashref) line that complains.

> Another possibility is that your modifications have caused the qsearch() 
> call to return one or more undefined values (since it's called in list
> context, it returns a list). 

Ahhhh.... I did leave the return correctly in the new, but I wasn't
so careful in the qsearch... I'll check that again.

> Yes, you need to use mod_perl and Apache::DBI for persistant database
> connections.  PHP4 may be able to handle persistant database connections
> within the context of PHP, but that wouldn't affect things running under
> mod_perl.

Bummer... compiling Mod_PERL makes compiling Apache with SSL and PHP4 look
like a cakewalk.  ;-)

					----Steve
Stephen Amadei
Dandy.net CTO
Atlantic City, NJ





More information about the freeside-users mailing list