Skip to content

xxfelixxx/perl-devel-scope

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

40 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

perl-devel-scope

Scope based debug!

Name

Devel::Scope

Build Status Coverage Status CPAN version

Version

Version 0.12

Synopsis

Perl library providing a debug function that prints based on the scoping level.

use Devel::Scope qw( debug );

debug("main"); # Main Scope

sub foo {
    debug("inside foo"); # Function Scope
    if ( 1 ) {
        debug("if true start calculations"); # Function Scope + 1
        for my $x ( 0..3 ) {
            debug("x is set to $x"); # Function Scope + 2
            for my $y ( 0..3 ) {
                debug("x=$x, y=$y"); # Function Scope + 3
                for my $z ( 0 ..3 ) {
                    debug("x=$x, y=$y, z=$z"); # Function Scope + 4
                }
            }
        }
        debug("end of calculaions");
    }
    debug("leaving foo");
}

...

DEVEL_SCOPE_DEPTH=3 perl foo.pl

About

Scope based debugging for perl.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages