Thanks for the report Ron.
Some comments below.
> my($id);
> my($session);
>
> {
> $session = CGI::Session -> new();
> $id = $session -> id();
>
> print "Inner scope. New session: $session. id: $id. \n";
> }
>
> print "Original scope. id: $id. \n";
>
> $session = CGI::Session -> load($id);
>
> print "Original scope. Old session: $session. id: ", $session -> id(), ". \n";
>
> if ($session -> is_empty() )
> {
> print "Original scope. Empty. \n";
>
> $session -> delete();
> }
Just to be clear here, there is only one "$session" here in one scope, the
global scope. Therefore, it probably never goes out of scope, requiring
an explicit flush.
While using "{" and "}" does create a smaller scope, variables don't
exist solely within that scope unless you create them there with "my".
Mark
-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems? Stop! Download the new AJAX search engine that makes
searching your log files as easy as surfing the web. DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click
|
Try Searching:
servers, voip, java, networking, microsoft ...
|
|
|
|