Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re^2: Parsing output

by ovedpo15 (Pilgrim)
on Aug 03, 2019 at 11:42 UTC ( [id://11103796]=note: print w/replies, xml ) Need Help??


in reply to Re: Parsing output
in thread Parsing output

Thanks for the suggestion, we already use MongoDB and it will take a lot of time to change it to an SQL DB because we have a lot of reports already in the MongoDB.
I will still try my luck here in waiting for a Perl suggestion.
Thank you for this post and all of the other as well!

Replies are listed 'Best First'.
Re^3: Parsing output
by holli (Abbot) on Aug 03, 2019 at 12:16 UTC
    You will probably have more luck, narrowing stuff down to pieces you have problems with into short example(s). We are here to help with the language and programming problems, not to solve your business logic.


    holli

    You can lead your users to water, but alas, you cannot drown them.
      What do you mean by "business logic". I'm just trying to understand from more experienced Perl programmers on how to approach this issue from Perl. I have added my "starter" code suggestion and where I stuck.
        I'm just trying to understand from more experienced Perl programmers on how to approach this issue from Perl.

        In general, we're happy to help, but please take into consideration that we're all volunteering our time here. If I open a question and see several pages worth of data with no code to run it against, that's going to take me a lot longer to wrap my head around, and if I'm busy, I'll have to set that question aside for later. A few bits of advice:

        • Reread How do I post a question effectively? and Short, Self-Contained, Correct Example. Questions that are "self-contained" contain a piece of code that is short and demonstrates the question/problem, is runnable as-is (others just have to download and run it), and your sample data can either be presented as a separate file to download, or you can even embed it in the code using here docs (my $data = <<'END'; ... END) or the __DATA__ section.
        • Is all the data you present in the root node really necessary for asking the question, or can some bits of the data structure be removed? Can you present the data structure in a more compact way? For example, { version => [ 'tcsh' ], group => 'pkgs' }, fits on a single line instead of six.
        • Anything else you can do to make it easier for others to run the code helps. For example, it's possible to embed your expected output of the code into the script, using e.g. Test::More's is_deeply to compare the output your script is currently generating to the expected output. See also How to ask better questions using Test::More and sample data. (As it stands, your question has nine different snippets of expected output, and if I wanted to write some code, I'd have to copy-and-paste those all together myself, figuring out which snippet is what as I go along.)
        • <update> And sorry to pile more on, but posting the wrong code is also something I'd suggest you try to avoid - consider that now, I have to worry that perhaps you made the same mistake in this root node? That's why self-contained, correct examples are best. </update>

        All of these things will generally get you more answers, higher-quality answers, and faster answers.

Re^3: Parsing output
by 1nickt (Canon) on Aug 03, 2019 at 14:10 UTC

    Well, good luck. I'll just note that I was not suggesting dumping Mongo. In fact I mentioned that you should be able to query your structured data there (https://docs.mongodb.com/manual/tutorial/query-embedded-documents/). I suggested marshalling your data for insertion into Mongo using a temporary SQL DB instead of the complex and hard-to-maintain Perl data manipulation routines you are struggling with.


    The way forward always starts with a minimal test.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://11103796]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (7)
As of 2024-04-23 19:06 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found