Text::Clip(3)
β¨ 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 betweenslurp => '[]'andslurp => '()'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>
π COPYRIGHT AND LICENSE π
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
- fedora 43: perl-Text-Clip 0.0014-33.fc43 Β· GPL-1.0-or-later OR Artistic-1.0-Perl
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms