in reply to Re: Modules not going out of scope
in thread Modules not going out of scope
So the objects should go out of scope once the sub has finished. However as I mentioned they don't automatically get 'destroyed'. I know this as the DESTROY method of the objects are not called, they are however called when I stop the server.#!/usr/bin/perl -w use CGI; use Session; use Community; use CGI::Carp; main(); sub main { my $query = new CGI; my $uri = 'www.moonfruit.com'; setup($uri, $query); } sub setup { my ($uri, $query) = @_; my $dbh = db_connect(); my $session= new Session($dbh, $query, "guest", $uri); my $community = new Community($session); print $query->header(); return; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Re: Modules not going out of scope
by perrin (Chancellor) on Feb 19, 2002 at 18:42 UTC |