Data::Properties::YAML - YAML-ized properties for your application


Data-Properties-YAML documentation  | view source Contained in the Data-Properties-YAML distribution.

Index


NAME

Top

Data::Properties::YAML - YAML-ized properties for your application

SYNOPSIS

Top

  use Data::Properties::YAML;

  my $yaml = Data::Properties::YAML->new(
    properties_file => '/etc/properties.yaml'
  );

  # OR:
  my $yaml = Data::Properties::YAML->new(
    yaml_data => <<'YAML',
  ---
  password_resend:
    general:
      is_not_found: Invalid email address
    contact_email:
      is_missing: Required
      is_invalid: Invalid email address
      is_not_found: Email is not valid - please try again.
  YAML
    );

  # Access your properties:
  print "Error: " . $yaml->general->is_not_found;

  # Access another property:
  print "Another error: " . $yaml->contact_email->is_missing;

  # Dies "Node root.general has no property named 'isnt_found'"
  $yaml->general->isnt_found; 

DESCRIPTION

Top

YAML is a simple way to store many strings. Why not use it in place of the typical "properties" file as used by java.util.properties?

Why not give ourselves a nice Perl-ish interface?

Well, here we go. Use Data::Properties::YAML and you have just that.

METHODS

Top

new( properties_file => '/path/to/file.yaml' )

Returns a new Data::Properties::YAML object based on the structure of your YAML.

new( yaml_data => $yaml )

Returns a new Data::Properties::YAML object based on the structure of your YAML.

SEE ALSO

Top

YAML

BUGS

Top

It's possible that some bugs have found their way into this release.

Use RT http://rt.cpan.org/NoAuth/Bugs.html?Dist=Data-Properties-YAML to submit bug reports.

HOMEPAGE

Top

Please visit the Apache2::ASP homepage at http://www.devstack.com/ to see examples of Data::Properties::YAML in action.

AUTHOR

Top

John Drago mailto:jdrago_999@yahoo.com

COPYRIGHT AND LICENSE

Top


Data-Properties-YAML documentation  | view source Contained in the Data-Properties-YAML distribution.