13.07.2015 Views

Perl 语言编程 - Linux教程

Perl 语言编程 - Linux教程

Perl 语言编程 - Linux教程

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

# 这 里 是 放 你 想 跟 踪 的 函 数 的 存 根 。sub trace {my $self = shift;local $Carp::CarpLevel = 1;Carp::cluck("\ntrace magical method") if $self->debug;}# 重 载 句 柄 以 打 印 出 我 们 的 路 径sub pathname {my $self = shift;confess "i am not a class method" unless ref $self;$$self->{PATHNAME} = shift if @_;return $$self->{PATHNAME};}# 双 重 模 式sub debug {my $self = shift;my $var = ref $self ? \$$self->{DEBUG} : \our $Debug;$$var = shift if @_;return ref $self ? $$self->{DEBUG} || $Debug : $Debug;}然 后 象 下 面 这 样 在 所 有 你 的 普 通 方 法 的 入 口 处 调 用 trace:sub GETC { $_[0]->trace;# 新 的386

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!