surya has asked for the wisdom of the Perl Monks concerning the following question:

hi

Im using Devel::cycle for finding leakage but i did not get the STDOUT statements(output) as it said in the description in cpan .Do i have to include any perl_mod for that to get output and also tell me where it will get print if i use STDOUT .


I included IO::Capture::Stdout even though i did not get .The below code is after using this module.
My code

my ($contact) = Denali::Contact->find(contact_id => 1);
print STDOUT find_cycle($contact);


but i did not get any output and i dono where to check please help urgently needed . Thanks in Advance

Replies are listed 'Best First'.
Re: how to use STDOUT in Devel::Cycle
by toolic (Bishop) on Oct 10, 2007 at 13:43 UTC
    Welcome to the Monastery.

    I know nothing about the modules you are trying to use, but perhaps these general debugging techniques will be of use to you (all code is untested).

    Use the strictures to help catch common mistakes:

    use warnings; use strict;

    Print out all intermediate values:

    use Data::Dumper; my ($contact) = Denali::Contact->find(contact_id => 1); print Dumper($contact);

    A quick look at the Devel::Cycle documentation states that:

    The find_cycle() function will traverse the object reference and print a report to STDOUT identifying any memory cycles it finds.
    So, you should try just:
    find_cycle($contact);
    instead of:
    print STDOUT find_cycle($contact);