Perl::C...entOpen(3)

πŸ“¦
version 1.001 Β· 2 versions
, in fedora 43

πŸ’– Perl::C...entOpen(3) πŸ’–

okay bestie, welcome to a page from User Contributed Perl Documentation β€” and before you panic at that truncated-looking title, that's just the manual name being its usual dramatic self. We're talking about the policy whose full name is Perl::Critic::Policy::Compatibility::ProhibitThreeArgumentOpen. Yes it's a mouthful. Yes it ate. Let's go. 🫢


✨ NAME ✨

Perl::Critic::Policy::Compatibility::ProhibitThreeArgumentOpen β€” don't let three-argument open slide unless your code is vibing on a perl version that actually supports it.


🌸 AFFILIATION 🌸

This policy is part of Perl::Critic::Compatibility. iykyk.


πŸŽ€ VERSION πŸŽ€

This doc describes Perl::Critic::Policy::Compatibility::ProhibitThreeArgumentOpen version 1.001. locked in.


πŸ¦‹ SYNOPSIS πŸ¦‹

No three-argument open, bestie β€” unless the module declares a dependency on perl 5.6 or higher. That's the whole deal.


πŸ’… DESCRIPTION πŸ’…

So here's the tea. Perls before 5.6 literally do not support the three-argument form of open. Not a skill issue, just a version issue. And if you want your code to stay compatible with those ancient perls, you cannot use it. periodt.

But!! If your code explicitly declares that it requires a perl version greater than or equal to 5.6, then three-argument open is totally fine and you may proceed, queen. πŸ‘‘

open FILE, '<', 'blah';             # not ok

use 5.006;
open FILE, '<', 'blah';             # ok

require 5.8.8;
open FILE, '<', 'blah';             # ok

See how the first one is out here catching violations with no version declared? embarrassing. πŸ™ˆ The other two declared their perl requirements first, so they're unbothered, unbothered, moisturized, in their lane. ✨


πŸ”₯ INTERFACE πŸ”₯

Standard for a Perl::Critic::Policy. nothing extra, nothing spicy. just the standard.


πŸ’€ DIAGNOSTICS πŸ’€

None. zero. zilch. no notes.


🌈 CONFIGURATION AND ENVIRONMENT 🌈

This policy has no configuration options beyond the standard ones. so you can't tweak it, bestie, it's already perfect. πŸ’…


πŸ“ DEPENDENCIES πŸ“

  • Perl::Critic

😭 INCOMPATIBILITIES 😭

okay this is the messy part. This policy directly contradicts Perl::Critic::Policy::InputOutput::ProhibitTwoArgOpen. like, they are beefing. fr fr.

If you don't declare perl version requirements, then you cannot have both of these policies enabled at the same time β€” unless you genuinely enjoy getting violations. and like, if that's your thing, no judgement, but also: chaos. 🚨


🧚 BUGS AND LIMITATIONS 🧚

No bugs have been reported. (iconic behaviour, honestly.)

Please report any bugs or feature requests to bug-perl-critic-compatible@rt.cpan.org, or through the web interface at <http://rt.cpan.org>. 🫢


⭐ ACKNOWLEDGMENTS ⭐

Adam Kennedy for inspiring this. Nay, demanding it. king behaviour, we respect it.


πŸ‘‘ AUTHOR πŸ‘‘

Elliot Shank <perl@galumph.com>


Copyright (c)2008, Elliot Shank <perl@galumph.com>. All rights reserved.

This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself. See perlartistic.


🌸 DISCLAIMER OF WARRANTY 🌸

bestie this part is in all caps because it's serious, not because I'm yelling at you. here it is, untouched:

BECAUSE THIS SOFTWARE IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE SOFTWARE, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE SOFTWARE "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE SOFTWARE IS WITH YOU. SHOULD THE SOFTWARE PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR, OR CORRECTION. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE SOFTWARE AS PERMITTED BY THE ABOVE LICENSE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE SOFTWARE (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE SOFTWARE TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.

and that's a wrap, gorgeous πŸŽ€ this page was served up by perl v5.42.0 on 2025-07-25, courtesy of your friends in User Contributed Perl Documentation. now go declare your perl version and open your files with three args like the main character you are. mwah. πŸ’–βœ¨

πŸ“¦ where this page comes from