Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re: How to acess Hash data

by kcott (Archbishop)
on Mar 28, 2014 at 20:08 UTC ( [id://1080148]=note: print w/replies, xml ) Need Help??


in reply to [untitled node, ID 1080084]

G'day milan.dalwadi,

Welcome to the monastery.

You show no declaraton of, nor assignment to, $start_end_brckt or $slack, yet you use these as hash keys. This could well be the reason for "only pathgroup name is there".

Overall, you appear to be using package global variables almost exclusively. This may well be causing you any number of additional problems.

I recommend you add these two lines to the top of your script and fix any issues Perl reports.

use strict; use warnings;

Those are documented in Pragmas. You should use them in all of your scripts.

I further recommend you use some logical indentation in your code. What you've presented here is very difficult to read and, as a result, highly error-prone. perlstyle can help you with this; also look at perltidy.

Those recommendations may resolve your problems. If you have further questions, please following the guidelines in "How do I post a question effectively?" (which will help us to help you).

-- Ken

Replies are listed 'Best First'.
1080191
by milan.dalwadi (Initiate) on Mar 29, 2014 at 07:36 UTC
        "Thanks for your reply ..."

        Thanking me is all well and good; however, as far as I can see, you've completely ignored every point and recommendation I made.

        As you've provided some more code and input data, here's my best guess at the type of thing you want:

        #!/usr/bin/env perl use strict; use warnings; use autodie; my $report_file = 'pm_1080084_timing_manual.rpt'; my %PG; local $/ = "\nStartpoint"; open my $fh, '<', $report_file; while (<$fh>) { /[(](\w+)[^(]+[(](\w+)[^:]+:\s+(\w+).*?slack[^-]+(-\d+)/s; $PG{$3}{"$1-$2"} = $4; } use Data::Dump; dd \%PG;

        This outputs:

        { PLBCLK => { "input-output" => -4, "rising-output" => -3 }, PLBCLK1 => { "input-rising" => -1, "rising-rising" => -2 }, }

        If you choose to ignore the points I raise, the links I provide, and the recommendations I make, that's fine. Of course, it would be a waste of my time to offer further help if it's going to be ignored.

        -- Ken

        Log In?
        Username:
        Password:

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

        How do I use this?Last hourOther CB clients
        Other Users?
        Others sharing their wisdom with the Monastery: (2)
        As of 2024-04-26 00:57 GMT
        Sections?
        Information?
        Find Nodes?
        Leftovers?
          Voting Booth?

          No recent polls found