The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

NAME

SWISH::Prog::Config - read & write Swish-e config files

SYNOPSIS

 use SWISH::Prog::Config;
 
 my $config = SWISH::Prog::Config->new;
 
 

DESCRIPTION

The Config class is intended to be accessed via SWISH::Prog new().

See the Swish-e documentation for a list of configuration parameters. Each parameter has an accessor/mutator method as part of the Config object. Forwards-compatability is offered for Swish3 with XML format config files.

METHODS

new( params )

Instatiate a new Config object. Takes a hash of key/value pairs, where each key may be a Swish-e configuration parameter.

Example:

 my $config = SWISH::Prog::Config->new( DefaultContents => 'HTML*' );
 
 print "DefaultContents is ", $config->DefaultContents, "\n";
 

metanames

Get/set list of Metanames.

propertynames

Get/set list of PropertyNames.

propertynamesnostripchars

Get/set list of PropertyNamesNoStripChars.

file

Returns name of the file written by write2().

write2( file/path )

Writes version 2 compatible config file.

If file/path is omitted, a temp file will be written using File::Temp.

Returns full path to file.

Full path is also available via file() method.

ver2_to_ver3( @files )

Utility method for converting Swish-e version 2 style config files to Swish3 XML style.

Takes an array of version 2 files and converts each to version 3 format, writing to same location with .xml appended.

NOTE: Some version 2 configuration options are not forward-compatible with version 3 and will be carp()ed about if found.

AUTHOR

Peter Karman, <perl@peknet.com>

COPYRIGHT AND LICENSE

Copyright 2006 by Peter Karman

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