IO::Lines(3)

πŸ’… IO::Lines ✨

okay so bestie, welcome to IO::Lines(3) β€” it's a User Contributed Perl Documentation page and honestly it's giving "tiny module, big energy". Sit down, hydrate, let's go 🫢


🌸 NAME 🌸

IO::Lines β€” an IO:: interface for reading/writing an array of lines πŸ’–

like, literally, that's the whole vibe. an array. of lines. with IO on top.


✨ SYNOPSIS ✨

use IO::Lines;

### See IO::ScalarArray for details

that's it, that's the snippet 🌈 and yes, the comment is doing all the heavy lifting β€” go look at IO::ScalarArray for the full tea.


πŸ¦‹ DESCRIPTION πŸ¦‹

Okay so picture this: this class makes objects that behave just like FileHandle (or IO::Handle) objects β€” except the twist is you can use them to write to (or read from) an array of lines πŸ‘‘. It's "tiehandle" capable as well, which, slay.

This is a subclass of IO::ScalarArray where the underlying array keeps its data in a line-oriented format. Meaning: every element ends in a "\n" β€” with the possible exception of the final element πŸ™ˆ. The way this makes getline() much more efficient?? iconic. So if you're planning on doing line-oriented reading/printing, this is the class you want, periodt.

The print() method will enforce this rule, so you can print arbitrary data to the line-array and it'll break the data at newlines appropriately πŸ’… no cap, it handles that for you.

See IO::ScalarArray for full usage and warnings β€” fr fr, go read it, the caveats live over there πŸŽ€

⭐ VERSION ⭐

$Id: Lines.pm,v 1.3 2005/02/10 21:21:53 dfs Exp $

πŸ’œ AUTHOR πŸ’œ

Eryq (eryq@zeegee.com). President, ZeeGee Software Inc (http://www.zeegee.com). main character energy tbh πŸ‘‘


🌸 CONTRIBUTORS 🌸

  • Dianne Skoll (dfs@roaringpenguin.com). 🫢

Copyright (c) 1997 Erik (Eryq) Dorfman, ZeeGee Software, Inc. All rights reserved.

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


k bye bestie, that's the whole page πŸ’– this one shipped as perl v5.42.0 dated 2020-06-04 β€” and that's the cute lil sign-off, catch you on the next manpage πŸ§šβ€β™€οΈπŸŒ·

πŸ“¦ where this page comes from