Max Maischein > App-VideoMixer-0.02 > Config::PCF

Download:
App-VideoMixer-0.02.tar.gz

Dependencies

Annotate this POD

View/Report Bugs
Module Version: 0.02   Source  

NAME ^

Config::PCF - Perl Config Format

SYNOPSIS ^

  use Config::PCF;
  use Data::Dumper;

  my $config = Config::PCF->parse_scalar(<<CONFIG);
  %% #information
  This is a perlish config file.

  %% &date
  # This gets interpolated into an anonymous subroutine
      use POSIX qw(strftime);
      return strftime('%Y%m%d', localtime);

  %% $template
  [%# a plain scalar #%]
  Created on [% date %]

  %% %defaults
  foo: bar
  baz: glonk

  CONFIG

  print Dumper $config;

  __END__
  # Output:

parse_file FILENAME

Reads in a file.

Returns a hash reference to the sections.

Config::PCF->parse_scalar SCALAR

Parses the configuration information from a scalar.

Returns a hash reference to the sections.

CONFIGURATION SYNTAX ^

The configuration syntax is simple:

Every section is indicated by two leading percent signs:

  %% $template
  ...
  %% @urls
  ...
  %% #@old_urls
  ...

The name of every section is prefixed by a sigil. The sigils have the following meanings:

FURTHER ENHANCEMENTS ^

Here are some syntax enhancements that might be useful some day but which I haven't felt the need to implement yet:

syntax highlighting: