Tie-Trace
view release on metacpan or search on metacpan
lib/Tie/Trace.pm view on Meta::CPAN
}elsif($s_type eq 'HASH'){
$s_ = { %$s };
}
Carp::croak("must pass one argument.") unless $s;
my @options = @_;
my $var_name;
eval{
$var_name = PadWalker::var_name(1, $s);
};
my $pkg = defined $var_name ? (caller)[0] : undef;
my $tied_value = tie $s_type eq 'SCALAR' ? $$s : $s_type eq 'ARRAY' ? @$s : %$s, "Tie::Trace", var => $var_name, pkg => $pkg, @options;
local $QUIET = 1;
if($s_type eq 'SCALAR'){
$$s = $s_;
}elsif($s_type eq 'ARRAY'){
@$s = @$s_ if @$s_;
}elsif($s_type eq 'HASH'){
%$s = %$s_ if %$s_;
}
lib/Tie/Trace.pm view on Meta::CPAN
filter => sub{$_[0] =~ s/^\'(.*)\'$/$1/; $_[0] =~s /\\'/'/g}
) unless $QUIET;
return $deleted;
}
sub SPLICE{
my $self = shift;
my $sz = @{$self->{storage}};
my $off = @_ ? shift : 0;
my $fetchsize = $self->FETCHSIZE;
my $caller_pkg = (caller)[0];
my $func = "";
if($caller_pkg eq "Tie::Trace::Array"){
$func = (caller 1)[3];
$func =~s/^Tie::Trace::Array:://;
}
$off += $sz if $off < 0;
my $len = @_ ? shift : $sz - $off;
my $to = $off + $len -1;
my $p = $off eq $to ? $off : $off < $to ? "$off .. $to" : $off;
my @point = ($func and $func ne 'STORESIZE') ? () : (point => $p);
( run in 0.314 second using v1.01-cache-2.11-cpan-a3c8064c92c )