---
name: "POEx::Role::SessionInstantiation::Meta::Session::Magic"
section: "3pm"
platform: "linux"
package: "libpoex-role-sessioninstantiation-perl"
version: "1.101040-1"
release: "Debian 6.0 (Squeeze)"
platforms: ["linux"]
url: "https://new.carta.tech/POEx::Role::SessionInstantiation::Meta::Session::Magic"
---

# POEx::Role::SessionInstantiation::Meta::Session::Magic(3pm)

Provides the magic necessary to integrate with POE

## NAME

POEx::Role::SessionInstantiation::Meta::Session::Magic - Provides the magic necessary to integrate with POE

## VERSION

version 1.101040

## PRIVATE\_ATTRIBUTES

### orig

```
    is: rw, isa: Str
```

orig stores the stringification of the original reference. This lets us fool POE into thinking that our new reference is the old reference.

### orig\_name

```
    is: rw, isa: Str
```

This stores the original meta name that would otherwise be lost

### \_self\_meta

```
    is: rw, isa: Str
```

This is where we store the newly created anonymous clone class to keep it from going out of scope

## PRIVATE\_METHODS

### overload "", !=, ==

Stringification, and numeric comparison are overridden so that we can fool POE into thinking that our inject reference is actually the same as the old  reference.

The numeric comparisons actually use string comparisons and stringifies the  provided arguments.

### after BUILD

All of the magic for turning the constructed object into a Session happens in  this method. If a BUILD is not provided, a stub exists to make sure this advice is executed. Internally, it delegates actual execution to \_post\_build to allow it to be advised.

### \_post\_build

\_post\_build does the magic of making sure our overload magic is activated and that we are registered with POE via `$poe_kernel`-\>session\_alloc.

### \_overload\_magic

To active the overload magic, use this method. This is what \_post\_build uses.

### \_poe\_register

To register this instance with POE, use this method. This is what \_post\_build uses.

### \_clone\_self

\_clone\_self does the initial anonymous class clone as needed to enable per instance modification via normal POE mechanisms.

## AUTHOR

```
  Nicholas Perez <nperez@cpan.org>
```

## COPYRIGHT AND LICENSE

This software is copyright (c) 2010 by Nicholas Perez.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
