[Catalyst] YAML Config

Oleg Pronin syber.rus at gmail.com
Tue Jul 24 14:10:06 GMT 2007


There is a var dir.
There are log dir, pid dir and data dir under var dir.
And a somelog.log under log dir.

Do you suggest to write
var_dir: __path_to(var)__
log_dir: __path_to(var/log)__
somelog: __path_to(var/log/somelog.log)__
pid_dir: __path_to(var/pid)__
data_dir: __path_to(var/data)__

?

Too many copy-pasting. And too many to change when var_dir changes.



2007/7/24, Ash Berlin <ash_cpan at firemirror.com>:
>
> Oleg Pronin wrote:
> > Hi.
> >
> > I would like to use references to variables that have been defined in my
> > yaml config.
> >
> > Something like this:
> >
> > var_dir: &var __path_to(var)__
> >
> > log_dir: &log *var/log
> > log_file: *log/file.txt
> >
> > This is a feature of YAML 1.0.
> > But it seems that only *pure* aliases (*var) work only in YAML::Syck &&
> > YAML::XS
> > log_dir: &log *var
> >
> > YAML dies with "YAML Error: Can't define both an anchor and an alias".
> >
> > And it is not clear for me how to modify *var to say: (this is a syntax
> > error in all parsers)
> > log_dir: &log *var/log
> >
> > How to use other variables' values in yaml config?
> >
> >
>
> "Don't?"
>
> I don't even know what those do. Why do you want them? whats wrong with
> just text values?
>
> _______________________________________________
> List: Catalyst at lists.rawmode.org
> Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst
> Searchable archive:
> http://www.mail-archive.com/catalyst@lists.rawmode.org/
> Dev site: http://dev.catalyst.perl.org/
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.scsys.co.uk/pipermail/catalyst/attachments/20070724/256e3=
7cf/attachment.htm


More information about the Catalyst mailing list