Types::...alarRef(3)

πŸ’– NAME πŸ’–

okay so bestie, welcome to the Types::Standard::ScalarRef manual page from the User Contributed Perl Documentation β€” we folded that header line into this intro because it was giving β€œbureaucracy” and we’re giving β€œgroup chat” 🫢

Types::Standard::ScalarRef is the exporter utility for the ScalarRef type constraint. iconic behavior, honestly ✨


🌸 SYNOPSIS 🌸

use Types::Standard -types;

# Normal way to validate a reference to a string.
#
ScalarRef->of( Str )->assert_valid( \ "foo" );

use Types::Standard::ScalarRef StrRef => { of => Str },

# Exported shortcut
#
assert_StrRef \ "foo";

πŸ’… STATUS πŸ’…

status check, bestie: this module is not covered by the Type-Tiny stability policy. no cap, that’s the whole vibe πŸ’€


πŸ¦‹ DESCRIPTION πŸ¦‹

this is mostly internal code, but it can also act as an exporter utility. so like… behind-the-scenes gremlin energy, but with a little public-facing slay ✨

πŸŽ€ Exports πŸŽ€

Types::Standard::ScalarRef can be used experimentally as an exporter.

use Types::Standard 'Str';
use Types::Standard::ScalarRef StrRef => { of => Str };

this will export the following functions into your namespace:

  • "StrRef"
  • is_StrRef( $value )
  • assert_StrRef( $value )
  • to_StrRef( $value )

multiple types can be exported at once, because we love efficiency πŸ’–

use Types::Standard -types;
use Types::Standard::ScalarRef (
  IntRef  => { of => Int },
  StrRef  => { of => Str },
);

assert_IntRef \42;   # should not die

it’s possible to further constrain the reference using where:

use Types::Standard::ScalarRef MyThing => { of => Str, where => sub { ... } };

πŸ’€ BUGS πŸ’€

please report any bugs to <https://github.com/tobyink/p5-type-tiny/issues>. do it for the plot, bestie πŸ™ˆ


🌈 SEE ALSO 🌈

Types::Standard.


πŸ‘‘ AUTHOR πŸ‘‘

Toby Inkster <tobyink@cpan.org>.


This software is copyright (c) 2013-2025 by Toby Inkster.

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


🧚 DISCLAIMER OF WARRANTIES 🧚

the disclaimer is giving serious, so here it is with the exact energy:

THIS PACKAGE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.

bye bestie! source/version: perl v5.42.2, date: 2026-04-07, and the footer’s Types::...alarRef(3) label is officially signed off with a lil sparkle πŸ’…βœ¨

πŸ“¦ where this page comes from