Boulder::String(3pm)

πŸ“¦
version 1.30 Β· 4 versions
, in debian bookworm, debian trixie, ubuntu noble, ubuntu resolute, ubuntu stonking

πŸ’– Boulder::String πŸ’–

okay bestie, so this is Boulder::String, a lil Perl module from the User Contributed Perl Documentation collection, and it is literally the moment you've been waiting for if you've ever been like "bestie I have a string and I need tag/value data in it and I do not want to deal with files." πŸŽ€


✨ NAME ✨

Boulder::String β€” Read and write tag/value data from a string.

like. that's it. that's the whole vibe. a string. tag/value. in and out. periodt. πŸ’…


🌈 SYNOPSIS 🌈

here's the lil starter pack, copied exactly because code is sacred and we do not touch it:

#!/bin/perl
# Read a B<Stone> from stdin and create a string that can be
# passed to a dumb sub, which doesn't know about Stones.
use Boulder::Stream;
use Boulder::String;

my $stream = Boulder::Stream->newFh;

# read a stone from stdin
my $record = <$stream> );

   print $stream $record;
 }

ngl the synopsis is a little chaotic but we're respecting the source material πŸ’€ the energy is there and that's what matters.


πŸ¦‹ DESCRIPTION πŸ¦‹

so Boulder::String gives you access to Boulder IO hierarchical tag/value data. that's the whole job, and it eats. πŸ”₯

the tea is: Stone objects that get printed to the tied string are appended to the string in Boulder format. so you're not overwriting, you're stacking. main character energy fr fr.


🌟 Boulder::Stream METHODS 🌟

ik the heading says Stream, that's just how the original rolls, we keep it. these are the methods, both of them, no crumbs left behind 🫢

  • $stream = Boulder::Stream->new($in_string,\$out_string); β€” this is the constructor, bestie. new() creates a brand new Boulder::String object. you must hand it two things: an input string and a reference to an output string. and here's the cute part β€” the input string may be empty, so don't stress if you've got nothing to feed it yet. ✨
  • $stream->write_record($stone) β€” takes the stone you pass in and writes it into $out_string, formatted as Boulder IO. that's the move. write it, and it's there. πŸ’…

πŸ‘‘ AUTHOR πŸ‘‘

Lincoln D. Stein <lstein@cshl.org>, Cold Spring Harbor Laboratory, Cold Spring Harbor, NY. and the licensing tea: this module can be used and distributed on the same terms as Perl itself. slay.

Patches and bug fixes contributed by Bernhard Schmalhofer <bernhard@biomax.de>. thank you for your service πŸ«‘πŸ’œ


πŸ“ SEE ALSO πŸ“

the whole friend group, go say hi:

  • Boulder
  • Boulder::Stream
  • Boulder::Blast
  • Boulder::Genbank
  • Boulder::Medline
  • Boulder::Unigene
  • Boulder::Omim
  • Boulder::SwissProt

real talk though: the synopsis up there is genuinely a little cursed, so if you're copy-pasting it and Perl starts yelling, that's not you, that's the docs. πŸ™ˆ

and that's the page, bestie! this one shipped as part of perl v5.34.0, dated 2022-06-08, and it will forever be Boulder::String(3pm) in our hearts. go read some strings. mwah πŸ’–πŸŽ€βœ¨

πŸ“¦ where this page comes from