App::S...n::Line(3pm)

✨ App::Sqitch::Plan::Line ✨

okay so bestie, this is the App::Sqitch::Plan::Line page from the Perl docs, and it's literally the blueprint for Sqitch deployment plan lines. it lives in the 3pm section of the manual, so you know it's a Perl module thing. let's get into it 🫢


πŸ’– NAME πŸ’–

App::Sqitch::Plan::Line β€” one single Sqitch deployment plan line. that's it, that's the whole job. iconic. ⭐


🌸 SYNOPSIS 🌸

my $plan = App::Sqitch::Plan->new( sqitch => $sqitch );
for my $line ($plan->lines) {
    say $line->as_string;
}

see? you make a plan, you loop over its lines, you print them. slay. πŸ’…


πŸ¦‹ DESCRIPTION πŸ¦‹

so an App::Sqitch::Plan::Line represents a single line from a Sqitch plan file. every object that an App::Sqitch::Plan object manages is derived from this class, lowkey.

and here's the tea: this is actually an abstract base class. you don't really use it directly, bestie, you use its concrete subclasses. those are App::Sqitch::Plan::Change, App::Sqitch::Plan::Tag, and App::Sqitch::Plan::Blank. periodt. πŸ‘‘


✨ INTERFACE ✨

πŸŽ€ Constructors πŸŽ€

new

my $plan = App::Sqitch::Plan::Line->new(%params);

instantiates and returns an App::Sqitch::Plan::Line object. here are the params you can pass, bestie:

  • plan β€” the App::Sqitch::Plan object that this line is associated with.
  • name β€” the name of the line. it should be empty for blank lines. and heads up: tag names should not include the leading @.
  • lspace β€” the white space from the beginning of the line, if there is any.
  • lopspace β€” the white space to the left of the operator, if any.
  • operator β€” an operator, if any.
  • ropspace β€” the white space to the right of the operator, if any.
  • rspace β€” the white space after the name, up until the end of the line or the start of a note.
  • note β€” a note. it does not include the leading #, but it does include any white space immediately after the # when the plan file gets parsed. no cap.

🌈 Accessors 🌈

plan

my $plan = $line->plan;

returns the plan object that the line object is chillin' with. 🫢

name

my $name = $line->name;

returns the name of the line. returns an empty string if there's no name. simple as that.

lspace

my $lspace = $line->lspace.

returns the white space from the beginning of the line, if any. πŸ“

rspace

my $rspace = $line->rspace.

returns the white space after the name, up until the end of the line or the start of a note.

note

my $note = $line->note.

returns the note. it does not include the leading #, but it does include any white space immediately after the # when the plan file is parsed. returns the empty string if there's no note. πŸ’œ


πŸ’… Instance Methods πŸ’…

format_name

my $formatted_name = $line->format_name;

returns the name of the line, properly formatted for output. for tags, it's the name with a leading @. for every other line, it's just... the name. no notes. 🌟

format_operator

my $formatted_operator = $line->format_operator;

returns the formatted representation of the operator. this is just the operator and its associated white space. and if neither the operator nor its white space exists, you get an empty string back. it's used internally by as_string(), so iykyk. πŸ”₯

format_content

my $formatted_content $line->format_content;

formats and returns the main content of the line. that's an operator and its associated white space, if any, followed by the formatted name.

format_note

my $note = $line->format_note;

returns the note formatted for output β€” meaning with a leading # and newlines encoded. cute. πŸŽ€

as_string

my $string = $line->as_string;

returns the full stringification of the line, suitable for output to a plan file. this is the glow-up version. ✨

request_note

my $note = $line->request_note( for => 'add' );

asks the user for a note. pass in the name of the command for which the note is requested via the for parameter. if there's already a note, it just gets returned, easy. otherwise, an editor gets launched and the user is asked to write one. once the editor exits, the note gets retrieved from the file, saved, and returned.

heads up bestie: if no note was written, an exception gets thrown with an exitval of 1. 😭

note_prompt

my $prompt = $line->note_prompt( for => 'tag' );

returns a localized string for use in the temporary file created by request_note(). pass in the name of the command you're prompting for via the for parameter. 🌸


πŸ‘‘ SEE ALSO πŸ‘‘

  • App::Sqitch::Plan β€” the class representing a plan.
  • sqitch β€” the Sqitch command-line client.

🫢 AUTHOR 🫢

David E. Wheeler <david@justatheory.com> β€” genuine legend, fr fr. πŸ’–


πŸ’œ LICENSE πŸ’œ

Copyright (c) 2012-2026 David E. Wheeler, 2012-2021 iovation Inc.

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.


and that's the whole page, bestie! this one's from perl v5.40.1, dated 2026-07-26, and it's the App::S...n::Line(3pm) page β€” the App::Sqitch::Plan::Line bit got squished in the header, but you know exactly what it is. now go format some lines. bye babe! πŸ’…βœ¨
πŸ“¦ where this page comes from