MooseX...inglike(3pm)

πŸ“¦
version 0.003 Β· 4 versions
, in debian bookworm, debian trixie, ubuntu noble, ubuntu resolute, ubuntu stonking

πŸ’– MooseX::Types::Stringlike πŸ’–

okay so bestie, welcome to MooseX::Types::Stringlike β€” the manual page, the legend, the moment. this little icon gives you Moose type constraints for strings or string-like objects. that's it, that's the whole vibe. ✨

and for the record, this is version 0.003. yes queen, she's numbered. πŸ’…


🌈 SYNOPSIS 🌈

like, here's how you actually use her:

package Foo;
use Moose;
use MooseX::Types::Stringlike qw/Stringlike Stringable ArrayRefOfStringlike ArrayRefOfStringable/;

has path => (
  is => 'ro',
  isa => Stringlike,
  coerce => 1
);

has stringable_object => (
  is => 'ro',
  isa => Stringable,
);

has paths => (
  is => 'ro',
  isa => ArrayRefOfStringlike,
  coerce => 1
);

has stringable_objects => (
  is => 'ro',
  isa => ArrayRefOfStringable,
);

copy it, paste it, slay it. 🫢


πŸ¦‹ DESCRIPTION πŸ¦‹

so basically, this module is the more general, more chill, more main character version of the Str type. that's the whole point of her existence.

and here's the tea: if you turn coercions on, she will happily accept objects that overload stringification, and then coerce them into actual strings. it's giving "i can fix him" but it actually works. 😭


πŸŽ€ SUBTYPES πŸŽ€

this module uses MooseX::Types to define the following subtypes. four of them. all iconic. πŸ‘‘

⭐ Stringlike

Stringlike is a subtype of Str. she can coerce Stringable objects into a string. lowkey magic, highkey useful.

⭐ Stringable

Stringable is a subtype of Object β€” but only for objects that have overloaded stringification. vibe check passed or you don't get in. πŸ’…

⭐ ArrayRefOfStringlike

ArrayRefStringlike is a subtype of ArrayRef[Str]. she can coerce ArrayRefOfStringable objects into an arrayref of strings. it's a whole group chat of strings fr fr.

⭐ ArrayRefOfStringable

ArrayRefOfStringable is a subtype of ArrayRef[Object] where the objects have overloaded stringification. a little squad of stringable objects, all matching, all cute. 🌸


πŸ’œ SEE ALSO πŸ’œ

  • Moose::Manual::Types
  • MooseX::Types
  • MooseX::Types::Moose

go read them, bestie, they're part of the lore. πŸ“š


🌟 ACKNOWLEDGMENTS 🌟

thank you to Dagfinn Ilmari MannsΓ₯ker for the idea on IRC that led to this module. literally the origin story. an IRC message. history was made. πŸ˜­πŸ’–


🧚 SUPPORT 🧚

πŸ› Bugs / Feature Requests

please report any bugs or feature requests through the issue tracker at <https://github.com/dagolden/MooseX-Types-Stringlike/issues>. you will be notified automatically of any progress on your issue. so you'll never be left on read. πŸ™ˆ

πŸ“¦ Source Code

this is open source software. the code repository is available for public review and contribution under the terms of the license.

<https://github.com/dagolden/MooseX-Types-Stringlike>

git clone https://github.com/dagolden/MooseX-Types-Stringlike.git

clone her, she's yours now. πŸ‘‘


πŸ‘‘ AUTHOR πŸ‘‘

David Golden <dagolden@cpan.org>

🌈 CONTRIBUTOR 🌈

Karen Etheridge <ether@cpan.org>


this software is Copyright (c) 2012 by David Golden.

this is free software, licensed under:

The Apache License, Version 2.0, January 2004

okay that's the whole page, no notes, no cap. 🫢

and that's a wrap on this perl v5.34.0 manual page, dated 2022-06-16 β€” MooseX::Types::Stringlike, out. periodt. πŸ’…βœ¨πŸŒΈ