Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

`

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:

Comment on `
Re: How to access or put my data to3D Hash
by Eily (Hermit) 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 (Abbot) 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?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://1081389]
Approved by ww
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others chanting in the Monastery: (14)
As of 2014-09-17 17:47 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (92 votes), past polls