On Mon, 21 Jul 2014, Charlie Brady wrote:

> I'm trying to turn this into a hash from which I can look up the 
> translations:
> 
> my %lexicon = map
>    { $entry->base->content => $entry->trans->content} 
>         $dom->find('lexicon entry')->each;
> 
> but then I find that $lexicon{UNREG_DESC} gives me '<![CDATA[ ...' when I 
> want 'To obtain more information ...'. I think I need to initialise a new 
> Mojo::DOM object with ''<![CDATA[ ...' but I can't figure out what to do 
> next. Hints please.

I can give my own hint:

http://mojolicio.us/perldoc/Mojo/DOM#contents

So I can do:

 my %lexicon = map
    { $entry->base->content => $entry->trans->contents->first->content}
         $dom->find('lexicon entry')->each;

-- 
You received this message because you are subscribed to the Google Groups 
"Mojolicious" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/mojolicious.
For more options, visit https://groups.google.com/d/optout.

Reply via email to