Moose:...Scalar(3pm)

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

πŸ’– Moose::Autobox::Scalar πŸ’–

okay bestie, this is Moose::Autobox::Scalar, a page straight out of the User Contributed Perl Documentation collection, and it's literally just one tiny lil role doing its thing. it's a 3pm manpage, so you know it's the real deal. sit down, grab a strawberry, we're doing this πŸ“


✨ NAME ✨

Moose::Autobox::Scalar β€” the Scalar role. that's it. that's the name. iconic, honestly.


🌸 VERSION 🌸

version 0.16. yes, we're on 0.16, no cap πŸ’…


πŸ¦‹ DESCRIPTION πŸ¦‹

so this is a role that describes a Scalar value. and what is a Scalar value, you ask? it's defined as the combination β€” like, a union sort of situation β€” of a String and a Number. that's the whole concept. two things, one scalar, slay ✨


πŸŽ€ METHODS πŸŽ€

here's the method lineup, bestie. heads up: some of these are just listed with no extra notes, so i'm not gonna make stuff up about them, we respect the source in this house 🫢

  • meta β€” it's here. that's all the page says about it, and i refuse to speculate πŸ’€
  • print β€” also just vibing in the list. no description given.
  • say β€” same energy. listed, no notes.

flatten

okay so this one DOES have a description, and it's cute: flattening a scalar just returns the scalar. that's the whole trick. which means you can literally say:

my @array = $input->flatten;

# Given $input of 5, @array is (5);
# Given $input of [ 5, 2, 0], @array is (5, 2, 0)

see how it works? a lone 5 stays 5, and an arrayref [ 5, 2, 0] unfolds into (5, 2, 0). lowkey satisfying ngl πŸ”₯

first

as per flatten. copy that, paste that, same behaviour πŸ’œ

last

as per flatten. yeah. same as flatten too. twins fr fr ✨


🌈 SUPPORT 🌈

got a bug? don't suffer in silence bestie, go tell somebody:

there's also a mailing list for users of this distribution, over at <http://lists.perl.org/list/moose.html>. join the chat, it's giving community πŸ’Œ

and there's an irc channel for users of this distribution too: #moose on irc.perl.org β€” <irc://irc.perl.org/#moose>. come through, iykyk πŸ‘‘


πŸ‘‘ AUTHOR πŸ‘‘

Stevan Little <stevan.little@iinteractive.com> β€” thank you for your service 🫑


This software is copyright (c) 2006 by Infinity Interactive, Inc.

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 like, go wild, respectfully 🌸


also just so you know: the methods listed up top without descriptions? yeah, the original page doesn't describe them either. i'm not about to invent lore for them. accuracy is the moment, periodt.

and that's the whole page, bestie!! this little gem was built for perl v5.34.0 and last touched on 2022-06-15 β€” go forth, flatten your scalars, and be the main character of your own autoboxing journey πŸ¦‹βœ¨πŸ’–

πŸ“¦ where this page comes from