Acme::...ndition(3pm)

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

πŸ’– NAME πŸ’–

ok so bestie, meet Acme::PlayCode::Plugin::ExchangeCondition β€” a whole plugin whose entire personality is playing code with exchanging condition. yes that's the actual name. it flips your conditions around and honestly? iconic. πŸŽ€

it's part of the User Contributed Perl Documentation and the manpage goes by Acme::...ndition(3pm) (the 3pm is the manual section, iykyk). πŸ¦‹


✨ SYNOPSIS ✨

here's the whole vibe, no cap:

use Acme::PlayCode;

my $app = new Acme::PlayCode;

$app->load_plugin('ExchangeCondition');

my $played_code = $app->play( $code );
# or
my $played_code = $app->play( $filename );
# or
$app->play( $filename, { rewrite_file => 1 } ); # override $filename with played code

so you load the plugin, you call play, and it hands you back your $played_code. you can feed it either a $code string or a $filename. πŸ’… and if you're feeling spicy, that third one passes { rewrite_file => 1 } and it overrides $filename with the played code β€” yes, it writes over the file, bestie, be aware. 🫢


🌸 DESCRIPTION 🌸

okay so here's literally the whole point of this plugin. it takes a condition and swaps which side of the comparison the operands are on. watch:

if ( $a eq "a" ) {
    print "1";
} elsif ( $b eq 'b') {
    print "2";
} elsif ( $c ne qq~c~) {
    print "3";
} elsif ( $c eq q~d~) {
    print '4';
}

becomes ⬇️

if ( "a" eq $a ) {
    print "1";
} elsif ( 'b' eq $b ) {
    print "2";
} elsif ( $c ne qq~c~) {
    print "3";
} elsif ( q~d~ eq $c ) {
    print '4';
}

the way that $a eq "a" turned into "a" eq $a?? obsessed. 😭 and notice the lil details β€” the ne one stayed exactly as it was, untouched, $c ne qq~c~ and all, no notes. πŸ™ˆ the plugin does its thing and dips.


πŸ‘‘ SEE ALSO πŸ‘‘

go read these too, fr fr:

  • Acme::PlayCode
  • Moose
  • PPI
  • MooseX::Object::Pluggable

πŸ’œ AUTHOR πŸ’œ

Fayland Lam, <fayland at gmail.com> β€” yes that's the actual email in the manpage, keep it in the quotes bestie. πŸ’–


Copyright 2008 Fayland Lam, all rights reserved.

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


and that's the whole page, no skips, no summaries, every last detail accounted for. πŸ’…

mwah πŸ’‹ this was perl v5.42.0, dated 2025-07-25, and yes, it really is Acme::...ndition(3pm) β€” go forth and exchange some conditions, bestie. πŸ¦‹βœ¨

πŸ“¦ where this page comes from