Acme::Ref - unstringify a reference


Acme-Ref documentation Contained in the Acme-Ref distribution.

Index


Code Index:

NAME

Top

Acme::Ref - unstringify a reference

SYNOPSIS

Top

  use Acme::Ref qw/deref/;
  my $h = { yomomma => q!so fat! };
  print deref("$h")->{yomomma};

DESCRIPTION

Top

  Allows Jaap to do twisted things.

  http://zoidberg.sf.net/

SEE ALSO

Top

  man perlguts

AUTHOR

Top

Raoul Zwart, <rlzwart@cpan.org>

COPYRIGHT AND LICENSE

Top


Acme-Ref documentation Contained in the Acme-Ref distribution.

package Acme::Ref;

use strict;
use warnings;
use base 'Exporter';

our @EXPORT_OK = ( 'deref' );

our $VERSION = '0.03';

require XSLoader;
XSLoader::load('Acme::Ref', $VERSION);

sub deref {
    my $str = shift;
    unless ($str) { return }
    $str =~ m/^(.*)\(0x(.*)\)$/;
    my ($cls,$ptr) = ($1,$2);
    $ptr = hex($ptr);
    _deref($ptr);
}

1;
__END__