Config...:Writer(3pm)
๐ 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
- debian trixie: libxmltv-perl 1.4.0-1 ยท GPL-2.0-only
- ubuntu resolute: libxmltv-perl 1.4.0-1 ยท GPL-2.0-only
- ubuntu stonking: libxmltv-perl 1.4.0-1 ยท GPL-2.0-only
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms