Created
November 5, 2012 14:29
-
-
Save syohex/4017457 to your computer and use it in GitHub Desktop.
Sample of Carp::CarpLevel
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!perl | |
use strict; | |
use warnings; | |
package Fuga; | |
sub bar { | |
Carp::croak("I'm bar"); | |
} | |
package Hoge; | |
use Carp (); | |
sub foo { | |
local $Carp::CarpLevel = $Carp::CarpLevel + 1; | |
Fuga::bar(); | |
} | |
package main; | |
Hoge::foo(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
syohei@ibanez:% perl level.pl | |
I'm bar at level.pl line 22. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment