# perldoc > Specio::DeclaredAt

---
type: CommandReference
command: Specio::DeclaredAt
mode: perldoc
section: ""
source: perldoc
---

## Quick Reference

- `new_from_caller($depth)` — create new object from call stack depth
- `$declared_at->package`, `$declared_at->filename`, `$declared_at->line` — accessors for call stack info (always populated)
- `$declared_at->subroutine` — returns subroutine name (may be undef)
- `$declared_at->has_subroutine` — check if subroutine name is set
- `$declared_at->description` — returns formatted string of declaration location

## Name

Specio::DeclaredAt - A class to represent where a type or coercion was declared

## Synopsis

perl
my $declared = Specio::DeclaredAt->new_from_caller(1);
print $declared->description;
## Options

- `Specio::DeclaredAt->new_from_caller($depth)` — Given a call stack depth, returns a new `Specio::DeclaredAt` object.
- `$declared_at->package` — Returns the package name from the call stack. Always populated.
- `$declared_at->filename` — Returns the filename from the call stack. Always populated.
- `$declared_at->line` — Returns the line number from the call stack. Always populated.
- `$declared_at->subroutine` — Returns the subroutine from the call stack. This may be an undef.
- `$declared_at->has_subroutine` — Returns true if there is a subroutine name associated with this object.
- `$declared_at->description` — Puts all the information together into a single string like "declared in package Foo::Bar (.../Foo/Bar.pm) at line 42 in sub named blah".

## Examples

perl
my $declared = Specio::DeclaredAt->new_from_caller(1);
print $declared->description;
