AnyDat...t::Pipe(3pm)

πŸ’– AnyData::Format::Pipe πŸ’–

okay bestie, gather round, because we're talking about AnyData::Format::Pipe(3pm) β€” one of those User Contributed Perl Documentation pages, and it's genuinely serving. this is the pipe-delimited format parser situation, and yes it does tiedhash and DBI/SQL access. iconic behavior, no notes.


✨ NAME ✨

AnyData::Format::Pipe β€” tiedhash & DBI/SQL access to Pipe delimited files πŸŽ€

like. it reads your pipe-delimited files. both ways. the tied hash way AND the SQL way. obsessed.


🌸 SYNOPSIS 🌸

first vibe β€” the tied hash route:

 use AnyData;
 my $table = adHash( 'Pipe', $filename,'r',$flags );
 while (my $row = each %$table) {
     print $row->{name},"\n" if $row->{country} =~ /us|mx|ca/;
 }
 # ... other tied hash operations

OR β€” and this is the other main character route β€” the DBI route:

  use DBI
 my $dbh = DBI->connect('dbi:AnyData:');
 $dbh->func('table1','Pipe', $filename,$flags,'ad_catalog');
 my $hits = $dbh->selectall_arrayref( qq{
     SELECT name FROM table1 WHERE country = 'us'
 });
 # ... other DBI/SQL operations

both of these? valid. both of these? slay. pick your fighter πŸ’…


πŸ¦‹ DESCRIPTION πŸ¦‹

so what is this thing, fr fr? it's a plug-in format parser for the AnyData and DBD::AnyData modules. that's the whole job. that's the assignment.

here's the tea on how it handles your columns: it will read column names from the first row of the file, or it will accept names passed by the user β€” whichever you want, bestie, it's flexible like that.

and it's not just column names you get to control. the user may set other options too, as follows:

  • col_names β€” a pipe separated list of column names 🫢
heads up bestie!! if you're using this with DBD::AnyData, you gotta put ad_ in front of the flags, e.g. ad_eol. don't forget the prefix, it's giving "required" because it IS required. 😭

and if you want the full lore, please refer to the documentation for AnyData.pm and DBD::AnyData.pm for further details. they're the prequels. go read them. πŸ’–


copyright 2000, Jeff Zucker <jeff@vpservices.com> all rights reserved 🌈


and that's the whole page, bestie, you ate it. πŸ’…βœ¨ this was perl v5.36.0, dated 2023-08-06 β€” thanks for coming to my ted talk, mwah πŸŽ€πŸ¦‹πŸ’œ

πŸ“¦ where this page comes from