Text::Clip(3)

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

✨ Text::Clip(3) ✨

okay bestie, this is the Text::Clip page from the User Contributed Perl Documentation, and honestly? it's giving clipboard energy but make it text. πŸ’– let's get into it.


πŸŽ€ NAME πŸŽ€

Text::Clip β€” clip and extract text in a clipboard-like way.

🌸 VERSION 🌸

version 0.0014 ✨ (yes, that's the one, no cap)

πŸ¦‹ SYNOPSIS πŸ¦‹

so here's the whole vibe, bestie β€” watch the marks do their thing:

$data = <<_END_
# Xyzzy
#   --- START
    qwerty

        1 2 3 4 5 6
8 9 10 The end

# abcdefghi
        jklmnop
_END_

$mark = Text::Clip->new( data => ... )->find( qr/#\s*--- START/ )
( $mark, $content ) = $mark->find( qr/ The end/, slurp => '[]' )

and then $content is literally this:

#   --- START
    qwerty

        1 2 3 4 5 6
8 9 10 The end

but wait, alternatively, if you do

( $mark, $content ) = $mark->find( qr/ The end/, slurp => '()' )

then $content is instead:

    qwerty

        1 2 3 4 5 6
πŸ‘€ notice the difference between slurp => '[]' and slurp => '()' in those two examples β€” that's the whole point of the demo, iykyk.

πŸ’œ DESCRIPTION πŸ’œ

Text::Clip lets you mark and slice up a piece of text. 🧚 string matching (by regular expression, etc.) is what places the marks. the first mark is your main character: it lets you access the text coming before it and after it. then every subsequent mark lets you slurp up the text that got "clipped" between the marks. periodt. πŸ’…

πŸ‘‘ AUTHOR πŸ‘‘

Robert Krimen <robertkrimen@gmail.com>

This software is copyright (c) 2010 by Robert Krimen.

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


and that's the whole page, bestie 🫢 huge shoutout to perl v5.42.0, dated 2025-07-25, filed under Text::Clip(3) β€” she's iconic, she's documented, she's free software. slay. πŸ’–βœ¨πŸŽ€

πŸ“¦ where this page comes from