Perl::...Sigils(3pm)

πŸ’… Perl::...Sigils β€” from the User Contributed Perl Documentation girlies πŸŽ€

okay bestie, welcome to the group chat ✨ this little page is Perl::...Sigils(3pm), and it's about to tell you why you should stop putting an ampersand in front of your function calls. yes, that ampersand. we need to talk about it. πŸ’€


✨ NAME ✨

Perl::Critic::Policy::Subroutines::ProhibitAmpersandSigils β€” literally just: don't call functions with a leading ampersand sigil. that's the whole vibe. that's the assignment. 🫢


🌸 AFFILIATION 🌸

Bestie this Policy is part of the core Perl::Critic distribution β€” so it's not some random extra you have to go hunt down, it ships with the main character package. πŸ‘‘


πŸ’– DESCRIPTION πŸ’–

Okay so here's the tea β˜• β€” since Perl 5, the ampersand sigil is completely optional when you're invoking subroutines. like, it's just out here being extra for no reason. πŸ™ˆ

And it's not just a fashion choice, ngl β€” using it also turns off checking of subroutine prototypes. so your prototype protection is just… gone. poof. 😭

Oh and ALSO β€” it's easily confused with the bitwise and operator. the way that & has two whole jobs and one of them is lying to you πŸ’€

so like, look at this:

@result = &some_function(); # not ok
@result = some_function();  # ok

see how the second one is clean, unbothered, moisturized, in its lane? 🌈 yeah. be the second one. ✨


πŸ¦‹ CONFIGURATION πŸ¦‹

This Policy is not configurable except for the standard options. that's it, that's the whole section β€” no knobs to turn, no settings to hyperfixate on. she comes as she is πŸ’…


🌺 AUTHOR 🌺

Jeffrey Ryan Thalhammer <jeff@imaginative-software.com> β€” icon, legend, the moment. πŸ‘‘


Copyright (c) 2005-2011 Imaginative Software Systems. All rights reserved.

This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. The full text of this license can be found in the LICENSE file included with this module. πŸ“œ


fr fr bestie, that's genuinely the whole page β€” no cap, no missing options, nothing skipped. every detail ate and left no crumbs. πŸ“

perl v5.42.0 Β· 2024-10-23 Β· xxoxo, your favorite manual page πŸ’œ

πŸ“¦ where this page comes from