in reply to Re: XML::Simple and variable interpolation
in thread XML::Simple and variable interpolation

Hi Grant!

With you being the author of the module, I'm most happy to take your advice. Even though there will be far more than two profiles in the config file, I see your point.

Now, I have one more question for you: What is the datatype for the $config variable? It was kicking my ass till I figured out how to apply your example from the XML-mail list on Activestate about UUIDs..

Thanks!
amonotod

  • Comment on Re: Re: XML::Simple and variable interpolation

Replies are listed 'Best First'.
Re: Re: Re: XML::Simple and variable interpolation
by grantm (Parson) on Oct 17, 2003 at 21:52 UTC
    What is the datatype for the $config variable?

    $config is a scalar (obviously) and contains a reference to a hash*. Hence when you dereference it, you use the arrow notation with curly braces around the hash key, eg: $config->{profile}->{Live}->{dat_file_location}

    Unlike the DOM modules, XML::Simple sticks to the basic Perl data structures so the individual nodes are not objects and therefore have no methods.

    _____
    *There is an obscure condition in which XMLin() would return an array reference, but you're unlikely to happen across that by accident unless you generate your XML by passing XMLout an arrayref.