Teodor Zlatanov > Devel-Callsite-0.04 > Devel::Callsite

Download:
Devel-Callsite-0.04.tar.gz

Dependencies

Annotate this POD

CPAN RT

Open  0
View/Report Bugs
Module Version: 0.04   Source   Latest Release: Devel-Callsite-0.08

NAME ^

Devel::Callsite - Get current callsite and interpreter context

SYNOPSIS ^

  use Devel::Callsite;
  sub $site { return callsite() };
  print $site->(), "\n"; # prints one number
  print $site->(), "\n"; # prints a different number

  print context(), "\n"; # prints the interpreter context, a number

DESCRIPTION ^

The callsite() function returns the callsite (a number) one level up from where it was called. See the tests for an example. It's useful for functions that need to uniquely know where they were called, such as Every::every() (see CPAN for that module).

The context() function returns the interpreter context as a number. This is a fairly unique number together with the call site.

HISTORY ^

Written by Ben Morrow on perl5-porters. CPAN-ified by Ted Zlatanov.

AUTHOR ^

Ben Morrow <ben@morrow.me.uk> Ted Zlatanov <tzz@lifelogs.com>

syntax highlighting: