in reply to XML::Simple and variable interpolation

You almost have it, look at the Dumper output closer, there is another level to your HoHs.

print $config->{'profile'}{$desired_config}{database_type};

HTH

P.S. Your first test should have worked. I cut and pasted it and it worked for me:

print $config->{profile}->{$desired_config}->{database_type}; print "\nTest1\n";

Replies are listed 'Best First'.
Re: Re: XML::Simple and variable interpolation
by amonotod (Acolyte) on Oct 17, 2003 at 17:56 UTC
    No freakin way...! I saved the posted code and data into seperate files, ran them, and they worked. What a bunch of crap.

    So, I renamed the old files, moved the new files into the same place, and they ran.

    Comparing the original with the new, I see no code differences. At all. Line by line, char by char, nothing different. (Not counting comment lines...)

    So, thank you, pzbagel. I appreciate the input...

    amonotod

      Are you by any chance working between a Windows box and a *nix machine? Perhaps you have some nasty \r characters in your original script or XML file. Those tend to cause weirdness especially with parsing and regexes. Try:

      cat -vET <file>

      The \r will show up as ^M at the end of lines before the $ characters(those command-line options cause cat to mark the end of each line with a $).

      HTH

        Actually, I have the oh-so-distinct pleasure of being on Windows only right now... :-(

        And, although I have run into that before and it isn't the case here, thank you!

        amonotod

        BTW, I have a page of scripts that I wrote a while back here:
        http://www.geocities.com/amonotod