https://github.com/code-hex/p5-acme-pointer
We can access to data using address as the string
https://github.com/code-hex/p5-acme-pointer
Last synced: 3 months ago
JSON representation
We can access to data using address as the string
- Host: GitHub
- URL: https://github.com/code-hex/p5-acme-pointer
- Owner: Code-Hex
- License: other
- Created: 2018-04-01T05:06:15.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2018-04-09T02:40:39.000Z (over 7 years ago)
- Last Synced: 2025-03-30T12:43:39.850Z (9 months ago)
- Language: C
- Size: 63.5 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: Changes
- License: LICENSE
Awesome Lists containing this project
README
# NAME
Acme::Pointer - We can access to data using address as the string
# SYNOPSIS
#!/usr/bin/env perl
use strict;
use warnings;
use utf8;
use feature qw/say/;
use Data::Dumper;
use Acme::Pointer;
my $a = {
a => 20,
b => [1,2]
};
my $b = "$a";
say $b;
print Dumper deref($b);
say "-" x 10;
if ($b =~ /[A-Z]+\((.*)\)/) {
print Dumper pointer($1);
}
# DESCRIPTION
Acme::Pointer by passing the address as the string to the function, you can access that address.
**THIS MODULE IS UNSAFE. DO NOT USE THIS IN PRODUCT.**
# METHODS
- `deref($ref :Str)`
You can pass the following string to this function.
CODE(0x7fd541a84a30)
HASH(0x7fd541a84a30)
ARRAY(0x7fd541a84a30)
SCALAR(0x7fd541a84a30)
If a character string other than these is passed, undef will be returned.
- `pointer($addr :Str)`
You can pass the string like "0x7fd541a84a30" to this function.
# LICENSE
Copyright (C) K.
This library is free software; you can redistribute it and/or modify
it under the same terms as Perl itself.
# AUTHOR
K