NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.
All the Perl that's Practical to Extract and Report
Stories, comments, journals, and other submissions on use Perl; are Copyright 1998-2006, their respective owners.
this is what you want (Score:1)
You are interested in the value of the "optional_features" key, and you expect that to be a ref to a list of two elements: the first element is "foo"; the second is a ref to a hash of the other data.
When you describe what you want you can see that the list has 2 elements. So in YAML you need one "-" for each element. So what you want is:
optional_features:
- foo
- description: test
requires_os: Linux
requires:
Test::More: 0.47
Reply to This
Re: (Score:1)
*This* is what you want:
optional_features:
- foo
- description: test
requires_os: Linux
requires:
Test::More: 0.47
Re: (Score:2)
Except it isn't ;)
optional_features is a list, with each element of the list being a map with an identifier. The indentation I'd used made it look like the list element had no identifier, hence why 'foo => undef' existed inside the map, when I meant for it be the identifier for the map. ferreira [perl.org] has put me on the right track.
As I suspected, I had just misunderstood the specs, as I didn't think I could have been the first person to come across this.
As for indenting in use.perl, you want '<ecode>'
Re: (Score:1)
You say "each element of the list being a map with an identifier". That is possible in Perl6, but in Perl5 a list (or array) element can only be a simple scalar or a reference to something.
So I think you must mean that you want a list that looks something like this: [ foo => {
Is that what you want?
That list has 2 elements: the first is "foo"; the second is a hashref.
In your initial post you sai