in reply to Obtain $data_ref from eval'ed input file that was filtered to look like Perl code

Hmmm... I smell another XY Problem... why filter it? Why not just parse it? If you're worried about those quotes, Text::ParseWords can help. Sounds like you already have most of the parser done, you just need to populate your hash instead of trasnforming it.

Or, perhaps Config::General would do?

There really is no need to go to eval STR here. Really.

  • Comment on Re: Obtain $data_ref from eval'ed input file that was filtered to look like Perl code

Replies are listed 'Best First'.
Re^2: Obtain $data_ref from eval'ed input file that was filtered to look like Perl code
by repellent (Priest) on Aug 05, 2008 at 23:45 UTC
    Why filter? The proprietary format of the input file is hairy, and I do not have documentation on it. However, filtering it allows me to leverage some consistency of its syntax, without expanding more work than needed.

    Config::General won't cut it. I am aware of Text::ParseWords.

    No, I don't have a full-fledge parser. My filter makes more assumptions than a crafted parser would, but it's good enough for me.