FFI::P...ointer(3pm)
π¦ FFI::Platypus::Type::StringPointer β a whole vibe (perl 3pm, User Contributed Perl Documentation) π¦
okay so bestie, welcome to the manual page for FFI::Platypus::Type::StringPointer. yes the header truncates it to FFI::P...ointer(3pm) which is giving "my name is too long for the tab bar" energy, but we move. this is a User Contributed Perl Documentation page, and it's literally all about converting a pointer to a string and back. π
β¨ NAME β¨
FFI::Platypus::Type::StringPointer β Convert a pointer to a string and back. that's it, that's the whole job, and it does it slayfully. π
π VERSION π
version 2.11. noted. remember it for the quiz. β¨
πΈ SYNOPSIS πΈ
okay so first, in your C code, it's giving very much this:
void
string_pointer_argument(const char **string)
{
...
}
const char **
string_pointer_return(void)
{
...
}
and then in your Platypus::FFI code, you do the cute little setup:
use FFI::Platypus 2.00;
my $ffi = FFI::Platypus->new( api => 2 );
$ffi->load_custom_type('::StringPointer' => 'string_pointer');
$ffi->attach(string_pointer_argument => ['string_pointer'] => 'void');
$ffi->attach(string_pointer_return => [] => 'string_pointer');
my $string = "foo";
string_pointer_argument(\$string); # $string may be modified
$ref = string_pointer_return();
print $$ref; # print the string pointed to by $ref
so yes, you pass a ref to your string, it may get modified (watch it π), and on the way back you get a ref and you deref it with $$ref to print the string pointed to by $ref. iconic behavior honestly. π«Ά
π§ DESCRIPTION π§
β οΈ NOTE: As of version0.61, this custom type is now deprecated since pointers to strings are supported in theFFI::Platypusdirectly without custom types.
ok so lowkey important: this thing still works, but it's deprecated, bestie. FFI::Platypus handles pointers to strings directly now, no custom type needed. (this is the "we love you but please use the new thing" era. π)
that said β what is it? this module provides a FFI::Platypus custom type for pointers to strings. simple. clean. main character energy. π
π SEE ALSO π
FFI::Platypusβ Main Platypus documentation. the big one. the mothership. go here first fr fr. πFFI::Platypus::Typeβ Platypus types documentation. all the type lore you could ever want. π
π AUTHOR π
Author: Graham Ollis <plicease@cpan.org> β absolute legend, no cap. π
Contributors (a whole squad, a full roster, we stan every single one):
- Bakkiaraj Murugesan (bakkiaraj)
- Dylan Cali (calid)
- pipcet
- Zaki Mughal (zmughal)
- Fitz Elliott (felliott)
- Vickenty Fesunov (vyf)
- Gregor Herrmann (gregoa)
- Shlomi Fish (shlomif)
- Damyan Ivanov
- Ilya Pavlov (Ilya33)
- Petr PΓsaΕ (ppisar)
- Mohammad S Anwar (MANWAR)
- HΓ₯kon HΓ¦gland (hakonhagland, HAKONH)
- Meredith (merrilymeredith, MHOWARD)
- Diab Jerius (DJERIUS)
- Eric Brine (IKEGAMI)
- szTheory
- JosΓ© JoaquΓn Atria (JJATRIA)
- Pete Houston (openstrike, HOUSTON)
- Lukas Mai (MAUKE)
like, that's a group chat and a half. πβ¨
π COPYRIGHT AND LICENSE π
This software is copyright (c) 2015-2022 by Graham Ollis.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. so yes, go off, remix it, share it, it's free software. π¦
okay and for the little sign-off: this whole page came from perl v5.42.3 and it's dated 2026-08-20, so if you're reading it in the future β hi, bestie, you're exactly on time. π
β¨πΈ
source/version deets: perl v5.42.3, 2026-08-20. mwah. π
π¦ where this page comes from
- ubuntu stonking: libffi-platypus-perl 2.11-1build1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms