sub replace_long { no strict; for (@_) { while ($_=~s/<\$(.*?)>/<!TMP!>/) { my $value=$$1; #eval "\$value=\$$var;"; $_=~s|<!TMP!>|$value|; } } use strict; } =cut






sub cHash { my $hash=shift; my $where=shift; my $what;#=shift;


return undef if $where=~/[^\w\d\[\]\{\}]/;

#=head1 my $where_p=$where; while (1) { print " +control $where_p\n" if $debug; last unless $where_p=~s/(.*)(\{.*?\}|\[.*?\])$/$1/; eval "if (not ref(\${\$hash}$where_p)){undef \${$hash}$where_p;}"; last unless $@; } #=cut

my $where_p=$where;
while ($where_p=~s/(.*)(\{.*?\}|\[.*?\])$/$1/)
{
        my $deleted=$2;

last unless $where_p;

print " + control $where_p/$deleted\n" if $debug;
$deleted=do{($deleted=~/]$/)?'ARRAY':'HASH'};
print "  + i need $deleted\n" if $debug;
#print "        +control $where_p/$deleted, mame tu ".$deleted."\n";

my $original;eval "\$original=ref(\${\$hash}$where_p)";
print "  + have $original\n" if $debug;

#last unless $where_p;
#next unless $original;

                if ($original ne $deleted)
                {
                        print "undef \${\$hash}$where_p;\n" if $debug;
                        eval "undef \${\$hash}$where_p;";
                        die $@ if $@;
                }
        }
}













1;


If published informations are not helpfull, something is missing or wrong, please report. Thanx for contribution.
This content is generated from file 'http://svn.cyclone3.org/trunk/frame/.core/.libs/Utils/vars.pm'

AddThis Social Bookmark Button RSS

User Comments