Config...:Writer(3pm)

๐Ÿ“ฆ
version 1.4.0 ยท 4 versions
, in debian trixie, ubuntu resolute, ubuntu stonking

๐Ÿ’– Config...:Writer(3pm) โ€” User Contributed Perl Documentation ๐Ÿ’–

okay bestie, gather round, we're doing Perl docs and we're doing them cutely. this is XMLTV::Configure::Writer, and yes the header up there says "User Contributed Perl Documentation" which is giving very much "the community came through" energy. โœจ


๐ŸŒธ NAME ๐ŸŒธ

XMLTV::Configure::Writer โ€” Configuration file writer for XMLTV grabbers

no cap, that's the whole name section. short, sweet, iconic. ๐Ÿ’…


๐Ÿฆ‹ DESCRIPTION ๐Ÿฆ‹

so basically? it's a utility class that helps grabbers write configuration descriptions. that's it. that's the vibe. it's the little helper that makes your grabber's config description not a whole mess. ๐Ÿซถ


โœจ SYNOPSIS โœจ

here's the whole glow-up in code form. copy it, love it, run it:

use XMLTV::Configure::Writer;

my $result;
my $writer = new XMLTV::Writer::Configure( OUTPUT => \$result,
                                           encoding => 'iso-8859-1' );
$writer->start( { grabber => 'tv_grab_xxx' } );
$writer->write_string( {
  id => 'username',
  title => [ [ 'Username', 'en' ],
             [ 'Anvรคndarnamn', 'sv' ] ],
  description => [ [ 'The username for logging in to DataDirect.', 'en' ],
                   [ 'Anvรคndarnamn hos DataDirect', 'sv' ] ],
  } );
$writer->start_selectone( {
  id => 'lineup',
  title => [ [ 'Lineup', 'en' ],
             [ 'Programpaket', 'sv' ] ],
  description => [ [ 'The lineup of channels for your region.', 'en' ],
                   [ 'Programpaket fรถr din region', 'sv' ] ],
  } );

$writer->write_option( {
  value=>'eastcoast',
  text=> => [ [ 'East Coast', 'en' ],
              [ 'ร–stkusten', 'sv' ] ]
} );

$writer->write_option( {
  value=>'westcoast',
  text=> => [ [ 'West Coast', 'en' ],
              [ 'Vรคstkusten', 'sv' ] ]
} );

$writer->end_selectone();

$writer->end();

print $result;

look at that multilingual realness. English AND Swedish, side by side, living their best lives. ๐ŸŒˆ (and yes, the text=> => double-arrow thing is literally in there โ€” we do not touch the original, we respect the original, periodt.)


๐ŸŽ€ EXPORTED FUNCTIONS ๐ŸŽ€

None.

literally nothing. zero. zilch. the void. ๐Ÿ™ˆ you gotta call everything as a method, bestie, no shortcuts here.


๐Ÿ‘‘ METHODS ๐Ÿ‘‘

๐Ÿ’œ start()

Write the start of the <xmltvconfiguration> element. Parameter is a hashref which gives the attributes of this element.

so you hand it a hashref and it opens up the whole <xmltvconfiguration> situation with those attributes. it's giving opening credits. ๐ŸŽฌ

๐Ÿ’œ write_string()

Write a <string> element. Parameter is a hashref with the data for the element:

$writer->write_string( {
  id => 'username',
  title => [ [ 'Username', 'en' ],
             [ 'Anvรคndarnamn', 'sv' ] ],
  description => [ [ 'The username for logging in to DataDirect.', 'en' ],
                   [ 'Anvรคndarnamn hos DataDirect', 'sv' ] ],
  default => "",
  } );

To add a constant use 'constant' key: If constant value is empty then revert to 'ask' procedure.

$writer->write_string( {
  id => 'version',
  title => [ [ 'Version number', 'en' ] ],
  description => [ [ 'Automatically added version number - no user input', 'en' ] ],
  constant => '123',
  } );

so yeah โ€” if you want a value that's just baked in, use 'constant'. but heads up: if that constant value comes through empty, it's not staying constant, it's reverting to the 'ask' procedure. main character can't make up its mind fr fr. ๐Ÿ˜ญ


๐Ÿซถ quick vibe check, bestie: every option, every code sample, every little detail up there is exactly as it was in the source. we keep the facts, we just serve them with flavor.

that's the whole page, babe. it came from perl v5.40.1, dated 2025-04-19, and it answers to the name Config...:Writer(3pm). slay, read it, use it, be the best grabber config writer you can be. ๐Ÿ’–โœจ๐ŸŽ€๐Ÿฆ‹๐ŸŒธ๐Ÿ’…

๐Ÿ“ฆ where this page comes from