kainwinterheart 16.02.2012 18:08 samael8981B856

use strict;
use warnings;

package asd;

our $cache = {};

sub new
{
my $self = bless( {}, ( ref( $_[ 0 ] ) or $_[ 0 ] ) );
return $self → zxc( 'qwe', $self );
}

sub zxc
{
my ( $self, $key, $val ) = @_;

my $result = $asd::cache → { $key } = $val;
$result ||= $asd::cache → { $key };

return $result;
}

sub DESTROY
{
delete $asd::cache → { 'qwe' };
}

mod_perl + apache2

Примерно в половине случаев asd → new() возвращает undef.

ЧТО ЗА НЕВЕДОМАЯ ЁБАНАЯ ХУЙНЯ??

Do you really want to delete ?