PPI::St...t::When(3)

πŸ’… PPI::St...t::When(3) β€” bestie edition ✨

okay so this page lives in the User Contributed Perl Documentation corner of the manual, and it's literally called PPI::St...t::When(3) (yes the title is abbreviated like that, no I did not do it, that's just how it ships 🫢). It's a Perl module page, it's giving very "one specific little job" energy, and honestly? We stan a specialist.


🌸 NAME 🌸

PPI::Statement::When β€” a when statement. that's it. that's the whole name. iconic, concise, no notes πŸ’–


✨ SYNOPSIS ✨

here's the vibe, bestie, straight up:

foreach ( qw/ foo bar baz / ) {
    when ( m/b/ ) {
        boing($_);
    }
    when ( m/f/ ) {
        boom($_);
    }
    default {
        tchak($_);
    }
}

like... when, when, default, boom boom tchak πŸŽ€ that's the whole demo.


πŸ¦‹ INHERITANCE πŸ¦‹

the family tree, and she is rooted:

PPI::Statement::When
isa PPI::Statement
    isa PPI::Node
        isa PPI::Element

so yeah, everything a PPI::Statement can do, she can do. everything a PPI::Node can do, she can do. everything a PPI::Element can do β€” you get it. heiress to the whole PPI empire, no cap πŸ‘‘


πŸ’œ DESCRIPTION πŸ’œ

PPI::Statement::When objects are the little guys that describe when and default statements β€” you know, the ones laid out over in perlsyn. if you've ever written a when ( m/.../ ) block and gone "hmm what object is this in PPI," it's this one. she's the description of those statements, periodt. 🌈


🧚 METHODS 🧚

here's the tea, and it's short and sweet:

PPI::Structure::When has no methods beyond those provided by the standard PPI::Structure, PPI::Node and PPI::Element methods.

(yes, that line says PPI::Structure::When β€” capital-S Structure β€” that's exactly what the page says and we are quoting it character for character, don't shoot the messenger πŸ™ˆ)

so: no custom methods. she inherits everything, adds nothing. lowkey a minimalist queen πŸ’…


πŸ”₯ TO DO πŸ”₯

the official list of things not done yet:

  • Write unit tests for this package

that's the whole list. one (1) item. someone please, the tests are right there 😭


🫢 SUPPORT 🫢

See the support section in the main module.

(go check the main module bestie, that's where the help lives ⭐)


πŸ‘‘ AUTHOR πŸ‘‘

Adam Kennedy <adamk@cpan.org>


Copyright 2001 - 2011 Adam Kennedy.

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

The full text of the license can be found in the LICENSE file included with this module.


and that's a wrap, babe πŸ’– this was perl v5.42.0, dated 2026-01-17, and the page we just read was PPI::St...t::When(3). go forth and parse responsibly πŸŽ€βœ¨πŸ¦‹

πŸ“¦ where this page comes from