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


by milan.dalwadi (Initiate)
on Apr 07, 2014 at 11:19 UTC ( #1081389=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 access or put my data to3D Hash
by Eily (Prior) on Apr 07, 2014 at 12:32 UTC

    To see what your hash looks like, you should use Data::Dumper like this: print Dumper \%PG; (you need to use the module first, of course).

    To see what's wrong with your code :

    use strict; use warnings;
    because you use variables that were never declared, put a value in a hash that you then never use, mess up scopes, and other mistakes that strict and warnings should have told you about.

Re: How to access or put my data to3D Hash
by NetWallah (Canon) on Apr 07, 2014 at 15:18 UTC
    Yes - please follow Eily's (++) advice and use 'strict'.

    Most likely, you have a typo in this line:

    $PG{$temp_{$cou}} = "$start_brckt$end_brckt";
    Do you actually have a hash named '%temp_" ?

    Your variables could be better named, and declared within the narrowest scope.

    If you post sample data, I'm sure an obliging monk would help you write code that parses it efficiently.

            What is the sound of Perl? Is it not the sound of a wall that people have stopped banging their heads against?
                  -Larry Wall, 1992

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others taking refuge in the Monastery: (5)
As of 2018-05-22 00:59 GMT
Find Nodes?
    Voting Booth?