The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Tie::Trace - easy print debugging with tie, for watching variable

VERSION

Version 0.17

SYNOPSIS

   use Tie::Trace qw/watch/; # or qw/:all/

   my %hash = (key => 'value');
   watch %hash;

   $hash{hoge} = 'hogehoge'; # warn "main:: %hash => {hoge} => hogehgoe at ..."

   my @array;
   tie @array;
   push @array, "array";    # warn "main:: @array [0] => array at ..."

   my $scalar;
   watch $scalar;
   $scalar = "scalar";      # warn "main:: $scalar => scalar at ..."

DESCRIPTION

This is useful for print debugging. Using tie mechanism, you can see stored/deleted value for the specified variable.

If the stored value is scalar/array/hash ref, this can check recursively.

for example;

watch %hash;

$hash{foo} = {a => 1, b => 2}; # warn "main:: %hash => {foo} => {a => 1, b => 2}"
$hash{foo}->{a} = 2            # warn "main:: %hash => {foo}{a} => 2"

But This ignores blessed reference and tied value.

FUNCTION

This provides one function watch from version 0.06. Then you should use only this function. Don't use tie function instead.

OPTIONS

You can use watch with some options. If you want global options, see "GLOBAL VARIABLES".

METHODS

It is used in coderef which is passed for options, for example, key, value and/or debug_value or as the method of the returned of tied function.

GLOBAL VARIABLES

AUTHOR

Ktat, <ktat.is at gmail.com>

BUGS

Please report any bugs or feature requests to bug-tie-debug at rt.cpan.org, or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Tie-Trace. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.

SUPPORT

You can find documentation for this module with the perldoc command.

perldoc Tie::Trace

You can also find documentation written in Japanese(euc-jp) for this module with the perldoc command.

perldoc Tie::Trace_JP

You can also look for information at:

ACKNOWLEDGEMENT

JN told me the idea of new warning message(from 0.06).

COPYRIGHT & LICENSE

Copyright 2006-2010 Ktat, all rights reserved.

This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.