Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"

by milan.dalwadi (Initiate)
on Mar 28, 2014 at 13:16 UTC ( #1080084=perlquestion: print w/replies, xml ) Need Help??
milan.dalwadi has asked for the wisdom of the Perl Monks concerning the following question:

Replies are listed 'Best First'.
Re: How to acess Hash data (PrimeTime)
by toolic (Bishop) on Mar 28, 2014 at 14:05 UTC
    This looks like it might be a PrimeTime static timing analysis report. A quick google search yields PrimeTime::Report. It has no passing tests, so it won't install easily (I was able to use cpan -f). But, you might be able to look at the source code to see how it parses the report.

    There are probably other tools out there, too.

    Re: How to acess Hash data
    by kcott (Chancellor) on Mar 28, 2014 at 20:08 UTC

      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

            "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?

      What's my password?
      Create A New User
      Node Status?
      node history
      Node Type: perlquestion [id://1080084]
      Approved by toolic
      and all is quiet...

      How do I use this? | Other CB clients
      Other Users?
      Others rifling through the Monastery: (5)
      As of 2018-06-23 07:05 GMT
      Find Nodes?
        Voting Booth?
        Should cpanminus be part of the standard Perl release?

        Results (125 votes). Check out past polls.